Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…rontend into translations
  • Loading branch information
gaweki committed Sep 10, 2020
2 parents 2fc4ca4 + 6156f38 commit 1e3a627
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 79 deletions.
2 changes: 0 additions & 2 deletions .replit

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

</div>
Expand All @@ -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...
Expand Down
2 changes: 1 addition & 1 deletion src/patients/care-plans/CarePlanTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`),
},
]}
Expand Down
72 changes: 0 additions & 72 deletions src/patients/patient-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -22,9 +21,7 @@ interface PatientState {
updateError?: Error
allergyError?: AddAllergyError
diagnosisError?: AddDiagnosisError
noteError?: AddNoteError
relatedPersonError?: AddRelatedPersonError
carePlanError?: AddCarePlanError
visitError?: AddVisitError
}

Expand Down Expand Up @@ -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
Expand All @@ -90,11 +70,8 @@ const initialState: PatientState = {
relatedPersons: [],
createError: undefined,
updateError: undefined,
allergyError: undefined,
diagnosisError: undefined,
noteError: undefined,
relatedPersonError: undefined,
carePlanError: undefined,
visitError: undefined,
}

Expand Down Expand Up @@ -129,10 +106,6 @@ const patientSlice = createSlice({
state.status = 'error'
state.updateError = payload
},
addAllergyError(state, { payload }: PayloadAction<AddAllergyError>) {
state.status = 'error'
state.allergyError = payload
},
addDiagnosisError(state, { payload }: PayloadAction<AddDiagnosisError>) {
state.status = 'error'
state.diagnosisError = payload
Expand All @@ -141,18 +114,6 @@ const patientSlice = createSlice({
state.status = 'error'
state.relatedPersonError = payload
},
addNoteError(state, { payload }: PayloadAction<AddRelatedPersonError>) {
state.status = 'error'
state.noteError = payload
},
addCarePlanError(state, { payload }: PayloadAction<AddRelatedPersonError>) {
state.status = 'error'
state.carePlanError = payload
},
addVisitError(state, { payload }: PayloadAction<AddVisitError>) {
state.status = 'error'
state.visitError = payload
},
},
})

Expand All @@ -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) => {
Expand Down Expand Up @@ -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 = {}

Expand Down

0 comments on commit 1e3a627

Please sign in to comment.