Unverified Commit 41bc96b1 authored by pom421's avatar pom421 Committed by GitHub
Browse files

feat: add new profile (#144)

parent 7b12e5c2
Pipeline #105799 passed with stage
in 52 seconds
......@@ -57,7 +57,7 @@ const DeceasedEdit = ({ dispatch, state, errors, hospital }) => {
<ActBlock
type="deathCause"
title="Quelle est la cause présumée du décès ?"
values={["Suicide", "Autre"]}
values={["Suicide", "Suicide probable", "Autre"]}
mode="toggle"
dispatch={dispatch}
state={state.deathCause || ""}
......
import PropTypes from "prop-types"
import React from "react"
import { Col, Row } from "reactstrap"
import ActBlock from "../ActBlock"
import ColumnAct from "../ColumnAct"
const FileStudyEdit = ({ dispatch, state, errors }) => {
return (
<>
<ActBlock
type="duration"
title="Durée"
values={["- de 2 heures", "2 à 4 heures", "4 à 8 heures", "+ de 8 heures"]}
mode="toggle"
dispatch={dispatch}
state={state.duration || ""}
invalid={!!errors.duration}
/>
</>
)
}
const FileStudyRead = (act) => {
return (
<>
<Row>
<Col className="mr-3">
<ColumnAct header={"Durée de la mobilisation"} content={act && act.duration} />
</Col>
</Row>
</>
)
}
const hasErrors = (state) => {
const errors = {}
if (!state.duration) {
errors.duration = "Obligatoire"
}
return errors
}
FileStudyEdit.propTypes = {
dispatch: PropTypes.func.isRequired,
errors: PropTypes.object,
state: PropTypes.object.isRequired,
}
export default {
edit: FileStudyEdit,
hasErrors,
read: FileStudyRead,
}
......@@ -7,6 +7,7 @@ import CriminalCourtProfile from "../components/profiles/CriminalCourtProfile"
import CustodyProfile from "../components/profiles/CustodyProfile"
import DeceasedProfile from "../components/profiles/DeceasedProfile"
import DrunkProfile from "../components/profiles/DrunkProfile"
import FileStudyProfile from "../components/profiles/FileStudyProfile"
import ReconstitutionProfile from "../components/profiles/ReconstitutionProfile"
import RestrainedProfile from "../components/profiles/RestrainedProfile"
import RoadRelatedExaminationProfile from "../components/profiles/RoadRelatedExaminationProfile"
......@@ -20,89 +21,91 @@ export const orderedProfileValues = [
"Examen pour OFPRA",
"Personne décédée",
{
subValues: ["Personne retenue", "Examen lié à la route", "IPM", "Assises", "Reconstitution", "Étude de dossier"],
title: "Autre activité",
subValues: ["Personne retenue", "Examen lié à la route", "IPM", "Assises", "Reconstitution"],
},
]
export const profiles = {
"Victime (vivante)": VictimProfile,
"Personne décédée": DeceasedProfile,
"Gardé.e à vue": CustodyProfile,
"Personne pour âge osseux (hors GAV)": BoneAgeProfile,
"Examen pour OFPRA": AsylumSeekerProfile,
"Autre activité/Personne retenue": RestrainedProfile,
"Autre activité/Assises": CriminalCourtProfile,
"Autre activité/Examen lié à la route": RoadRelatedExaminationProfile,
"Autre activité/IPM": DrunkProfile,
"Autre activité/Assises": CriminalCourtProfile,
"Autre activité/Personne retenue": RestrainedProfile,
"Autre activité/Reconstitution": ReconstitutionProfile,
"Autre activité/Étude de dossier": FileStudyProfile,
"Examen pour OFPRA": AsylumSeekerProfile,
"Gardé.e à vue": CustodyProfile,
"Personne décédée": DeceasedProfile,
"Personne pour âge osseux (hors GAV)": BoneAgeProfile,
"Victime (vivante)": VictimProfile,
}
export const livingProfiles = [
{ value: "Victime (vivante)", label: "Victime" },
{ value: "Gardé.e à vue", label: "Gardé.e à vue" },
{ value: "Personne pour âge osseux (hors GAV)", label: "Personne pour âge osseux" },
{ value: "Examen pour OFPRA", label: "Examen pour OFPRA" },
{ value: "Autre activité/Personne retenue", label: "Personne retenue" },
{ value: "Autre activité/Examen lié à la route", label: "Examen lié à la route" },
{ value: "Autre activité/IPM", label: "IPM" },
{ label: "Victime", value: "Victime (vivante)" },
{ label: "Gardé.e à vue", value: "Gardé.e à vue" },
{ label: "Personne pour âge osseux", value: "Personne pour âge osseux (hors GAV)" },
{ label: "Examen pour OFPRA", value: "Examen pour OFPRA" },
{ label: "Personne retenue", value: "Autre activité/Personne retenue" },
{ label: "Examen lié à la route", value: "Autre activité/Examen lié à la route" },
{ label: "IPM", value: "Autre activité/IPM" },
{ label: "Étude de dossier", value: "Autre activité/Étude de dossier" },
]
const periodOfDayValues = {
week: {
title: "lun.-ven.",
saturday: {
period: [
{
title: "Nuit profonde",
subTitle: "(00h-8h30)",
title: "Nuit profonde",
},
{
title: "Journée",
subTitle: "(8h30-18h30)",
subTitle: "(8h30-12h30)",
title: "Matin",
},
{
subTitle: "(12h30-18h)",
title: "Après-midi",
},
{
subTitle: "(18h-00h)",
title: "Soirée",
subTitle: "(18h30-00h)",
},
],
},
saturday: {
title: "sam.",
},
sunday: {
period: [
{
title: "Nuit profonde",
subTitle: "(00h-8h30)",
title: "Nuit profonde",
},
{
title: "Matin",
subTitle: "(8h30-12h30)",
},
{
title: "Après-midi",
subTitle: "(12h30-18h)",
subTitle: "(08h30-18h30)",
title: "Journée",
},
{
subTitle: "(18h30-00h)",
title: "Soirée",
subTitle: "(18h-00h)",
},
],
},
sunday: {
title: "dim. et férié",
},
week: {
period: [
{
title: "Nuit profonde",
subTitle: "(00h-8h30)",
title: "Nuit profonde",
},
{
subTitle: "(8h30-18h30)",
title: "Journée",
subTitle: "(08h30-18h30)",
},
{
title: "Soirée",
subTitle: "(18h30-00h)",
title: "Soirée",
},
],
title: "lun.-ven.",
},
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment