diff --git a/.replit b/.replit deleted file mode 100644 index e5ab7812bc..0000000000 --- a/.replit +++ /dev/null @@ -1,2 +0,0 @@ -language = "nodejs" -run = "npm start" diff --git a/README.md b/README.md index 42928a8062..dd1ef4e355 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![Status](https://img.shields.io/badge/Status-developing-brightgree) [![Release](https://img.shields.io/github/release/HospitalRun/hospitalrun-frontend.svg)](https://github.com/HospitalRun/hospitalrun-frontend/releases) [![Version](https://img.shields.io/github/package-json/v/hospitalrun/hospitalrun-frontend)](https://github.com/HospitalRun/hospitalrun-frontend/releases) [![GitHub CI](https://github.com/HospitalRun/frontend/workflows/GitHub%20CI/badge.svg)](https://github.com/HospitalRun/frontend/actions) [![Coverage Status](https://coveralls.io/repos/github/HospitalRun/hospitalrun-frontend/badge.svg?branch=master)](https://coveralls.io/github/HospitalRun/hospitalrun-frontend?branch=master) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/HospitalRun/hospitalrun-frontend.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/HospitalRun/hospitalrun-frontend/context:javascript) ![Code scanning](https://github.com/HospitalRun/hospitalrun-frontend/workflows/Code%20scanning/badge.svg?branch=master) [![Documentation Status](https://readthedocs.org/projects/hospitalrun-frontend/badge/?version=latest)](https://hospitalrun-frontend.readthedocs.io) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FHospitalRun%2Fhospitalrun-frontend.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FHospitalRun%2Fhospitalrun-frontend?ref=badge_large) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) -![dependabot](https://api.dependabot.com/badges/status?host=github&repo=HospitalRun/hospitalrun-frontend) [![Slack](https://hospitalrun-slack.herokuapp.com/badge.svg)](https://hospitalrun-slack.herokuapp.com) [![Run on Repl.it](https://repl.it/badge/github/HospitalRun/hospitalrun-frontend)](https://repl.it/github/HospitalRun/hospitalrun-frontend) +![dependabot](https://api.dependabot.com/badges/status?host=github&repo=HospitalRun/hospitalrun-frontend) [![Slack](https://hospitalrun-slack.herokuapp.com/badge.svg)](https://hospitalrun-slack.herokuapp.com) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/HospitalRun/hospitalrun-frontend) @@ -20,9 +20,9 @@ React frontend for [HospitalRun](http://hospitalrun.io/): free software for deve - How can I deploy 1.0.0-beta? - Where do I report a bug or request a feature? -- How can I contribute? (There are several other ways besides coding) -- What is the project structure? -- What is the application infrastructure? +- How can I contribute? (There are several other ways besides coding) +- What is the project structure? +- What is the application infrastructure? - Who is behind HospitalRun? etc. # Would you like to contribute? If yes... diff --git a/src/patients/care-plans/CarePlanTable.tsx b/src/patients/care-plans/CarePlanTable.tsx index a606af73d6..387961709e 100644 --- a/src/patients/care-plans/CarePlanTable.tsx +++ b/src/patients/care-plans/CarePlanTable.tsx @@ -52,7 +52,7 @@ const CarePlanTable = (props: Props) => { actionsHeaderText={t('actions.label')} actions={[ { - label: 'actions.view', + label: t('actions.view'), action: (row) => history.push(`/patients/${patientId}/care-plans/${row.id}`), }, ]} diff --git a/src/patients/hooks/useAddPatientNote.ts b/src/patients/hooks/useAddPatientNote.tsx similarity index 100% rename from src/patients/hooks/useAddPatientNote.ts rename to src/patients/hooks/useAddPatientNote.tsx diff --git a/src/patients/hooks/usePatientNote.ts b/src/patients/hooks/usePatientNote.tsx similarity index 100% rename from src/patients/hooks/usePatientNote.ts rename to src/patients/hooks/usePatientNote.tsx diff --git a/src/patients/hooks/usePatientNotes.ts b/src/patients/hooks/usePatientNotes.tsx similarity index 100% rename from src/patients/hooks/usePatientNotes.ts rename to src/patients/hooks/usePatientNotes.tsx diff --git a/src/patients/patient-slice.ts b/src/patients/patient-slice.ts index 7dcf0a82ca..36fcfdd0a4 100644 --- a/src/patients/patient-slice.ts +++ b/src/patients/patient-slice.ts @@ -5,7 +5,6 @@ import validator from 'validator' import PatientRepository from '../shared/db/PatientRepository' import Diagnosis from '../shared/model/Diagnosis' -import Note from '../shared/model/Note' import Patient from '../shared/model/Patient' import RelatedPerson from '../shared/model/RelatedPerson' import Visit from '../shared/model/Visit' @@ -22,9 +21,7 @@ interface PatientState { updateError?: Error allergyError?: AddAllergyError diagnosisError?: AddDiagnosisError - noteError?: AddNoteError relatedPersonError?: AddRelatedPersonError - carePlanError?: AddCarePlanError visitError?: AddVisitError } @@ -58,23 +55,6 @@ interface AddDiagnosisError { status?: string } -interface AddNoteError { - message?: string - note?: string -} - -interface AddCarePlanError { - message?: string - title?: string - description?: string - status?: string - intent?: string - startDate?: string - endDate?: string - note?: string - condition?: string -} - interface AddVisitError { message?: string status?: string @@ -90,11 +70,8 @@ const initialState: PatientState = { relatedPersons: [], createError: undefined, updateError: undefined, - allergyError: undefined, diagnosisError: undefined, - noteError: undefined, relatedPersonError: undefined, - carePlanError: undefined, visitError: undefined, } @@ -129,10 +106,6 @@ const patientSlice = createSlice({ state.status = 'error' state.updateError = payload }, - addAllergyError(state, { payload }: PayloadAction) { - state.status = 'error' - state.allergyError = payload - }, addDiagnosisError(state, { payload }: PayloadAction) { state.status = 'error' state.diagnosisError = payload @@ -141,18 +114,6 @@ const patientSlice = createSlice({ state.status = 'error' state.relatedPersonError = payload }, - addNoteError(state, { payload }: PayloadAction) { - state.status = 'error' - state.noteError = payload - }, - addCarePlanError(state, { payload }: PayloadAction) { - state.status = 'error' - state.carePlanError = payload - }, - addVisitError(state, { payload }: PayloadAction) { - state.status = 'error' - state.visitError = payload - }, }, }) @@ -165,12 +126,8 @@ export const { updatePatientStart, updatePatientSuccess, updatePatientError, - addAllergyError, addDiagnosisError, addRelatedPersonError, - addNoteError, - addCarePlanError, - addVisitError, } = patientSlice.actions export const fetchPatient = (id: string): AppThunk => async (dispatch) => { @@ -383,35 +340,6 @@ export const addDiagnosis = ( } } -function validateNote(note: Note) { - const error: AddNoteError = {} - if (!note.text) { - error.message = 'patient.notes.error.noteRequired' - } - - return error -} - -export const addNote = ( - patientId: string, - note: Note, - onSuccess?: (patient: Patient) => void, -): AppThunk => async (dispatch) => { - const newNoteError = validateNote(note) - - if (isEmpty(newNoteError)) { - const patient = await PatientRepository.find(patientId) - const notes = patient.notes || [] - notes.push({ id: uuid(), date: new Date().toISOString(), ...note }) - patient.notes = notes - - await dispatch(updatePatient(patient, onSuccess)) - } else { - newNoteError.message = 'patient.notes.error.unableToAdd' - dispatch(addNoteError(newNoteError)) - } -} - function validateVisit(visit: Visit): AddVisitError { const error: AddVisitError = {}