Skip to content

Commit

Permalink
Merge pull request #395 from noharm-ai/develop
Browse files Browse the repository at this point in the history
v4.0.22
  • Loading branch information
marceloarocha authored Jan 27, 2025
2 parents 8e486aa + 74ba83c commit 24fff81
Show file tree
Hide file tree
Showing 18 changed files with 693 additions and 195 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "noharm-app",
"version": "4.0.21",
"version": "4.0.22",
"private": true,
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^35.0.1",
Expand Down
54 changes: 27 additions & 27 deletions src/components/Forms/ClinicalNotes/util/customTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,126 +58,126 @@ export const getCustomClinicalNote = (
resultText = examsByType(resultText, prescription);

return resultText
.replace("{{data_atual}}", formatDate(dayjs()))
.replace("{{nome_paciente}}", prescription.data.namePatient)
.replace("{{peso_paciente}}", getWeight(prescription.data.weight))
.replace("{{altura_paciente}}", getHeight(prescription.data.height))
.replace("{{idade_paciente}}", getAge(prescription.data.age))
.replace("{{escore_global}}", prescription.data.features?.globalScore)
.replace(
.replaceAll("{{data_atual}}", formatDate(dayjs()))
.replaceAll("{{nome_paciente}}", prescription.data.namePatient)
.replaceAll("{{peso_paciente}}", getWeight(prescription.data.weight))
.replaceAll("{{altura_paciente}}", getHeight(prescription.data.height))
.replaceAll("{{idade_paciente}}", getAge(prescription.data.age))
.replaceAll("{{escore_global}}", prescription.data.features?.globalScore)
.replaceAll(
"{{risco_paciente}}",
getPatientRisk(
prescription.data.agg,
prescription.data.features?.globalScore
)
)
.replace(
.replaceAll(
"{{imc_paciente}}",
getPatientIMC(prescription.data.weight, prescription.data.height)
)
.replace(
.replaceAll(
"{{superficie_corporal_paciente}}",
getPatientCorporalSurface(
prescription.data.weight,
prescription.data.height
)
)
.replace("{{exames}}", getExams(prescription.data.exams))
.replace("{{alergias}}", getAllergies(prescription.data.notesAllergies))
.replace(
.replaceAll("{{exames}}", getExams(prescription.data.exams))
.replaceAll("{{alergias}}", getAllergies(prescription.data.notesAllergies))
.replaceAll(
"{{intervencoes}}",
interventions || "Nenhuma intervenção registrada"
)
.replace("{{alertas}}", alerts || "Nenhum alerta registrado")
.replace(
.replaceAll("{{alertas}}", alerts || "Nenhum alerta registrado")
.replaceAll(
"{{medicamentos_conciliados}}",
conciliationDrugsWithRelation || "--"
)
.replace(
.replaceAll(
"{{medicamentos_nao_conciliados}}",
conciliationDrugsWithoutRelation || "--"
)
.replace(
.replaceAll(
"{{antimicrobianos}}",
getDrugsByAttribute(drugs, "am", {
period: true,
empty: "Nenhum Antimicrobiano encontrado.",
})
)
.replace(
.replaceAll(
"{{nao_padronizados}}",
getDrugsByAttribute(drugs, "np", {
period: false,
empty: "Nenhum medicamento Não Padronizado encontrado.",
})
)
.replace(
.replaceAll(
"{{alta_vigilancia}}",
getDrugsByAttribute(drugs, "av", {
empty: "Nenhum medicamento de Alta Vigilância encontrado",
})
)
.replace(
.replaceAll(
"{{controlados}}",
getDrugsByAttribute(drugs, "c", {
empty: "Nenhum medicamento Controlado encontrado.",
})
)
.replace(
.replaceAll(
"{{dialisaveis}}",
getDialyzable(drugs, prescription.data.dialysis, {
empty: "Nenhum medicamento Dialisável encontrado.",
})
)
.replace(
.replaceAll(
"{{antitromboticos}}",
getDrugsByClass(
drugs,
["B1"],
"Nenhum medicamento Antitrombótico encontrado."
)
)
.replace(
.replaceAll(
"{{profilaxia_ulcera_estresse}}",
getDrugsByClass(
drugs,
["A02B"],
"Nenhum medicamento de Profilaxia de Úlcera de Estresse encontrado."
)
)
.replace(
.replaceAll(
"{{profilaxia_ocular}}",
getDrugsByClass(
drugs,
["S1K1", "S1X2"],
"Nenhum medicamento de Profilaxia Ocular encontrado."
)
)
.replace(
.replaceAll(
"{{analgesicos}}",
getDrugsByClass(
drugs,
["N2"],
"Nenhum medicamento Analgésico encontrado."
)
)
.replace(
.replaceAll(
"{{anestesicos_gerais}}",
getDrugsByClass(
drugs,
["N1A1", "N1A2"],
"Nenhum medicamento Anestésico Geral encontrado."
)
)
.replace(
.replaceAll(
"{{vasopressores_inotropicos}}",
getDrugsByClass(
drugs,
["C1C", "C1F", "H4D"],
"Nenhum medicamento Vasopressor ou Inotrópico encontrado."
)
)
.replace(
.replaceAll(
"{{assinatura}}",
signatureTemplate(params.signature, params.account)
);
Expand Down
64 changes: 42 additions & 22 deletions src/components/References/ScoreWizard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function ScoreWizard({
drugUnits,
updateDrugData,
saveUnitCoefficient,
security,
}) {
const [currentStep, setCurrentStep] = useState(0);
const [validationErrors, setValidationErrors] = useState({});
Expand Down Expand Up @@ -252,15 +251,13 @@ export default function ScoreWizard({
de doses, selecione essa opção.
</p>
<Row gutter={24} align="middle" type="flex">
<Col md={5} xxl={3}>
<Heading as="label" size="14px" textAlign="right">
<Col md={1}></Col>
<Col md={24 - 5} xxl={24 - 3}>
<Heading as="label" size="14px">
<Tooltip title="">Divisor de faixas:</Tooltip>
</Heading>
</Col>
<Col md={24 - 5} xxl={24 - 3}>
<InputNumber
style={{
width: 120,
marginRight: "10px",
}}
min={0}
Expand All @@ -270,23 +267,46 @@ export default function ScoreWizard({
updateDrugData({ division: value, touched: true })
}
className={validationErrors.division ? "error" : ""}
addonAfter={getMeasureUnit(
drugData.idMeasureUnit,
drugUnits.list
)}
/>
<span
style={{
marginRight: "10px",
}}
>
{getMeasureUnit(drugData.idMeasureUnit, drugUnits.list)}
</span>
<Checkbox
value={drugData.useWeight}
checked={drugData.useWeight}
onChange={onChangeUseWeight}
>
<Tooltip title="Somente será considerado peso se houver Divisor de Faixas atribuído">
Considerar peso
</Tooltip>
</Checkbox>
<div style={{ marginTop: "5px" }}>
<Checkbox
value={drugData.useWeight}
checked={drugData.useWeight}
onChange={onChangeUseWeight}
>
<Tooltip title="Somente será considerado peso se houver Divisor de Faixas atribuído">
Considerar peso
</Tooltip>
</Checkbox>
</div>
{drugData.substance?.divisionRange && (
<div
style={{
opacity: 0.7,
fontSize: "12px",
marginTop: "5px",
cursor: "pointer",
}}
onClick={() =>
updateDrugData({
division: drugData.substance?.divisionRange,
touched: true,
})
}
>
<Tooltip title="Clique para utilizar este valor">
Sugestão: {drugData.substance?.divisionRange}{" "}
{drugData.substance?.unit
? `${drugData.substance?.unit}/Kg`
: "Unidade indefinida"}
</Tooltip>
</div>
)}

{validationErrors.division && (
<div className="error-description">
{validationErrors.division}
Expand Down
18 changes: 18 additions & 0 deletions src/components/Tag.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
import Tag from "antd/lib/tag";

export default Tag;

export const tagRender = (color) => (props) => {
const { label, closable, onClose } = props;
const onPreventMouseDown = (event) => {
event.preventDefault();
event.stopPropagation();
};
return (
<Tag
color={color}
onMouseDown={onPreventMouseDown}
closable={closable}
onClose={onClose}
>
{label}
</Tag>
);
};
80 changes: 37 additions & 43 deletions src/features/admin/DrugAttributes/CopyAttributes/CopyAttributes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ function CopyAttributes({ open, setOpen, reload, ...props }) {
const segmentList = useSelector((state) => state.segments.list);

const validationSchema = Yup.object().shape({
idSegmentOrigin: Yup.string()
.nullable()
.required(t("validation.requiredField")),
idSegmentDestiny: Yup.string()
.nullable()
.required(t("validation.requiredField")),
Expand Down Expand Up @@ -230,50 +227,47 @@ function CopyAttributes({ open, setOpen, reload, ...props }) {
</div>
</div>

<div
className={`form-row ${
errors.idSegmentOrigin && touched.idSegmentOrigin ? "error" : ""
}`}
>
<div className="form-label">
<label>Segmento origem:</label>
</div>
<div className="form-input">
<Select
onChange={(value) => setFieldValue("idSegmentOrigin", value)}
value={values.idSegmentOrigin}
status={
{!values.fromAdminSchema && (
<>
<div
className={`form-row ${
errors.idSegmentOrigin && touched.idSegmentOrigin
? "error"
: null
}
optionFilterProp="children"
showSearch
autoFocus
allowClear
: ""
}`}
>
{values.fromAdminSchema ? (
<>
<Select.Option key={5} value={5}>
Curadoria Adulto
</Select.Option>
<Select.Option key={7} value={7}>
Curadoria Pediátrica
</Select.Option>
</>
) : (
segmentList.map(({ id, description: text }) => (
<Select.Option key={id} value={id}>
{text}
</Select.Option>
))
<div className="form-label">
<label>Segmento origem:</label>
</div>
<div className="form-input">
<Select
onChange={(value) =>
setFieldValue("idSegmentOrigin", value)
}
value={values.idSegmentOrigin}
status={
errors.idSegmentOrigin && touched.idSegmentOrigin
? "error"
: null
}
optionFilterProp="children"
showSearch
autoFocus
allowClear
>
{segmentList.map(({ id, description: text }) => (
<Select.Option key={id} value={id}>
{text}
</Select.Option>
))}
</Select>
</div>
{errors.idSegmentOrigin && touched.idSegmentOrigin && (
<div className="form-error">{errors.idSegmentOrigin}</div>
)}
</Select>
</div>
{errors.idSegmentOrigin && touched.idSegmentOrigin && (
<div className="form-error">{errors.idSegmentOrigin}</div>
)}
</div>
</div>
</>
)}

<div
className={`form-row ${
Expand Down
3 changes: 2 additions & 1 deletion src/features/admin/DrugAttributes/Table/EditSubstance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ export default function EditPriceConversion({ idDrug, sctid, accuracy }) {
loading={substancesLoading}
allowClear
>
{substances.map(({ sctid, name }) => (
{substances.map(({ sctid, name, active }) => (
<Select.Option key={sctid} value={sctid}>
{active ? "" : "(INATIVO) "}
{name}
</Select.Option>
))}
Expand Down
Loading

0 comments on commit 24fff81

Please sign in to comment.