Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Update the value to Home Health in Create Encounter Form #9806

Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ REACT_JWT_TOKEN_REFRESH_INTERVAL=
# Minimum encounter date (default: 2020-01-01)
REACT_MIN_ENCOUNTER_DATE=

# Default Encounter Type (default: "hh" - Home Health)
REACT_DEFAULT_ENCOUNTER_TYPE=

# Available languages to switch between (2 Digit language code seperated by comas. See src->Locale->config.ts for available codes)
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"
5 changes: 5 additions & 0 deletions care.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { EncounterClass } from "@/types/emr/encounter";

const env = import.meta.env;

interface ILogo {
Expand Down Expand Up @@ -48,6 +50,9 @@ const careConfig = {
.split(",")
.map((l) => l.trim()),

defaultEncounterType: (env.REACT_DEFAULT_ENCOUNTER_TYPE ||
"hh") as EncounterClass,

gmapsApiKey:
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk",

Expand Down
3 changes: 2 additions & 1 deletion src/components/Encounter/CreateEncounterForm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import careConfig from "@careConfig";
import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import {
Expand Down Expand Up @@ -139,7 +140,7 @@ export default function CreateEncounterForm({
resolver: zodResolver(encounterFormSchema),
defaultValues: {
status: "planned",
encounter_class: encounterClass || "amb",
encounter_class: encounterClass || careConfig.defaultEncounterType,
priority: "routine",
organizations: [],
},
Expand Down
1 change: 0 additions & 1 deletion src/types/notes/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export interface Message {
created_by: UserBase;
updated_by: UserBase;
}

1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface ImportMetaEnv {
readonly REACT_STILL_WATCHING_PROMPT_DURATION?: string;
readonly REACT_JWT_TOKEN_REFRESH_INTERVAL?: string;
readonly REACT_MIN_ENCOUNTER_DATE?: string;
readonly REACT_DEFAULT_ENCOUNTER_TYPE?: string;
readonly REACT_ALLOWED_LOCALES?: string;
readonly REACT_ENABLED_APPS?: string;

Expand Down
Loading