Skip to content

Commit

Permalink
Progress Notes: Adds support for filing Resp. support and Neurologica…
Browse files Browse the repository at this point in the history
…l Monitoring data (#8109)

* Progress Notes: Adds support for filing Resp. support and Neurological Monitoring data

* remove console log
  • Loading branch information
rithviknishad authored Jul 9, 2024
1 parent 36e156f commit a76b958
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ let basicEditor = (~facilityId, ~patientId, ~consultationId, ~id) => {
href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds/${id}/update`}>
<div className="flex items-center">
<CareIcon icon="l-user-nurse" className="text-xl mr-4 text-green-500" />

<div className={`font-semibold text-xl text-green-500`}> {str("Basic Editor")} </div>
</div>
<div> <CareIcon icon="l-check-circle" className="text-3xl text-green-500" /> </div>
<div>
<CareIcon icon="l-check-circle" className="text-3xl text-green-500" />
</div>
</Link>
}
let editorNameToString = editor => {
Expand Down Expand Up @@ -94,7 +95,7 @@ let reducer = (state, action) => {
| ShowEditor(editor) => {...state, visibleEditor: Some(editor)}
| CloseEditor => {...state, visibleEditor: None}
| UpdateDailyRound(dailyRound, editor) => {
dailyRound: dailyRound,
dailyRound,
visibleEditor: None,
updatedEditors: Js.Array.concat([editor], state.updatedEditors),
}
Expand All @@ -103,7 +104,7 @@ let reducer = (state, action) => {

let initialState = dailyRound => {
visibleEditor: None,
dailyRound: dailyRound,
dailyRound,
updatedEditors: [],
}

Expand All @@ -115,6 +116,21 @@ let updateDailyRound = (send, editor, dailyRound) => {
let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => {
let (state, send) = React.useReducer(reducer, initialState(dailyRound))

let sections =
dailyRound.roundsType == VentilatorRound
? [
HemodynamicParametersEditor,
NeurologicalMonitoringEditor,
VentilatorParametersEditor,
ArterialBloodGasAnalysisEditor,
BloodSugarEditor,
IOBalanceEditor,
DialysisEditor,
PressureSoreEditor,
NursingCareEditor,
]
: [NeurologicalMonitoringEditor, VentilatorParametersEditor]

<div className=" px-4 py-5 sm:px-6 max-w-5xl mx-auto mt-4">
{ReactUtils.nullUnless(
<div>
Expand Down Expand Up @@ -222,25 +238,15 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => {
className="bg-white px-2 md:px-6 py-5 border-b border-gray-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg">
<h2> {str("Record Updates")} </h2>
<div>
{basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} {Js.Array.map(editor => {
{basicEditor(~facilityId, ~patientId, ~consultationId, ~id)}
{Js.Array.map(editor => {
editorToggle(editor, state, send)
}, [
HemodynamicParametersEditor,
NeurologicalMonitoringEditor,
VentilatorParametersEditor,
ArterialBloodGasAnalysisEditor,
BloodSugarEditor,
IOBalanceEditor,
DialysisEditor,
PressureSoreEditor,
NursingCareEditor,
])->React.array}
}, sections)->React.array}
</div>
<Link
href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`}>
<button
onClick={_ =>
Notifications.success({msg: "Detailed Update filed successfully"})}
onClick={_ => Notifications.success({msg: "Detailed Update filed successfully"})}
className="btn btn-primary w-full mt-6">
{str("Complete")}
</button>
Expand Down
12 changes: 2 additions & 10 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,7 @@ export const DailyRounds = (props: any) => {
Notification.Success({
msg: `${t(obj.rounds_type as string)} log updated successfully`,
});
if (
["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
state.form.rounds_type,
)
) {
if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
Expand All @@ -369,11 +365,7 @@ export const DailyRounds = (props: any) => {
msg: `${t(state.form.rounds_type)} log created successfully`,
});

if (
["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
state.form.rounds_type,
)
) {
if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
Expand Down

0 comments on commit a76b958

Please sign in to comment.