Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,26 @@ export function EncounterQuestion({
});

useEffect(() => {
const isStartDateInFuture =
encounter.period.start && new Date(encounter.period.start) > new Date();
Comment thread
Jacobjeevan marked this conversation as resolved.
Outdated
Comment thread
Jacobjeevan marked this conversation as resolved.
Outdated

if (
encounter.status === EncounterStatus.DISCHARGED ||
encounter.status === EncounterStatus.COMPLETED ||
encounter.status === EncounterStatus.CANCELLED ||
encounter.status === EncounterStatus.DISCONTINUED ||
encounter.status === EncounterStatus.ENTERED_IN_ERROR
Comment thread
Jacobjeevan marked this conversation as resolved.
) {
if (!encounter.period.end) {
if (isStartDateInFuture) {
if (encounter.period.end) {
handleUpdateEncounter({
period: {
...encounter.period,
end: undefined,
},
});
}
} else if (!encounter.period.end) {
handleUpdateEncounter({
period: {
...encounter.period,
Expand Down
Loading