Skip to content

Commit

Permalink
Merge pull request #459 from masslight/develop
Browse files Browse the repository at this point in the history
release 0.13 Manatee
  • Loading branch information
GiladSchneider authored Sep 30, 2024
2 parents 8b6337d + e24b901 commit 549d8cb
Show file tree
Hide file tree
Showing 35 changed files with 103 additions and 240 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ottehr",
"version": "0.12.0",
"version": "0.13.0",
"private": true,
"scripts": {
"test": "pnpm recursive run test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface UCAppointmentInformation extends AppointmentMessaging {
comment: string | undefined;
appointmentType?: AppointmentType;
appointmentStatus: string;
encounterId: string;
status: VisitStatus;
cancellationReason: string | undefined;
provider: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/ehr-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ehr-utils",
"private": true,
"version": "0.12.0",
"version": "0.13.0",
"main": "lib/main.ts",
"types": "lib/main.ts",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const CustomContainer: FC<ContainerProps> = ({
const { isAuthenticated, logout } = useAuth0();

const handleLogout = useCallback(() => {
localStorage.removeItem('welcomePath');
if (logoutHandler !== undefined) {
logoutHandler();
} else {
Expand Down Expand Up @@ -137,6 +138,7 @@ export const CustomContainer: FC<ContainerProps> = ({
backgroundColor: 'rgba(226, 240, 255, 0.5)',
},
}}
onClick={() => localStorage.removeItem('welcomePath')}
>
<img src={portal} alt="Profile icon" />
</Box>
Expand Down
2 changes: 1 addition & 1 deletion packages/ottehr-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ottehr-components",
"private": true,
"version": "0.12.0",
"version": "0.13.0",
"main": "lib/main.ts",
"types": "lib/main.ts",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/telemed-ehr/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "telemed-ehr-app",
"version": "0.12.0",
"version": "0.13.0",
"private": true,
"browserslist": {
"production": [
Expand Down Expand Up @@ -29,7 +29,7 @@
"build-skeleton": "tsc && vite build --mode ${ENV}",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy:development": " PREFIX=development CLOUDFRONT_ID=E10TA6FN58D1OS ENV=dev pnpm run ci-deploy-skeleton",
"deploy:development": " PREFIX=development CLOUDFRONT_ID=E10TA6FN58D1OS ENV=development pnpm run ci-deploy-skeleton",
"ci-deploy-skeleton": "ENV=${ENV} VITE_APP_SHA=${GIT_HEAD:-$(git rev-parse --short HEAD)} VITE_APP_VERSION=$(node -pe 'require(\"./package.json\").version') pnpm run build:dev && aws s3 sync build/ s3://ehr.ottehr.com --region us-east-1 --delete && aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths '/*' --region us-east-1"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/telemed-ehr/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { isLocalOrDevOrTestingOrTrainingEnv } from './telemed/utils/env.helper';
import { RoleType } from './types/types';
import { AppointmentPage } from './pages/AppointmentPage';
import AddSchedulePage from './pages/AddSchedulePage';
import Version from './pages/Version';

const enablePhoton = false && isLocalOrDevOrTestingOrTrainingEnv;

Expand Down Expand Up @@ -89,6 +90,7 @@ function App(): ReactElement {
/>
}
>
<Route path="/version" element={<Version />} />
{roleUnknown && (
<>
<Route path="/logout" element={<Logout />} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
TableRow,
Tooltip,
Typography,
capitalize,
useTheme,
} from '@mui/material';
import { Location } from 'fhir/r4';
Expand Down Expand Up @@ -296,7 +295,7 @@ export default function AppointmentTableRow({
setNoteSaving(false);
setEditingRow(false);
setEditingComment(false);
await updateAppointments();
updateAppointments();
};

useEffect(() => {
Expand All @@ -315,9 +314,9 @@ export default function AppointmentTableRow({
throw new Error('error getting appointment id');
}
setArrivedStatusSaving(true);
await checkinPatient(fhirClient, appointment.id);
await checkinPatient(fhirClient, appointment.id, appointment.encounterId);
setArrivedStatusSaving(false);
await updateAppointments();
updateAppointments();
};

const recentStatus = appointment?.visitStatusHistory[appointment.visitStatusHistory.length - 1];
Expand Down
37 changes: 26 additions & 11 deletions packages/telemed-ehr/app/src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Appointment, Location, Resource } from 'fhir/r4';
import { DateTime } from 'luxon';
import { formatDateUsingSlashes, getTimezone } from '../helpers/formatDateTime';
import { lastModifiedCode } from '../types/types';
import { UCAppointmentInformation, User, getPatchOperationForNewMetaTag } from 'ehr-utils';
import { UCAppointmentInformation, User, getPatchBinary, getPatchOperationForNewMetaTag } from 'ehr-utils';
import { getPatchOperationsToUpdateVisitStatus } from './mappingUtils';

export const classifyAppointments = (appointments: UCAppointmentInformation[]): Map<any, any> => {
const statusCounts = new Map();
Expand All @@ -22,21 +23,35 @@ export const messageIsFromPatient = (message: Message): boolean => {
return message.author?.startsWith('+') ?? false;
};

export const checkinPatient = async (fhirClient: FhirClient, appointmentId: string): Promise<void> => {
export const checkinPatient = async (
fhirClient: FhirClient,
appointmentId: string,
encounterId: string,
): Promise<void> => {
const appointmentToUpdate = await fhirClient.readResource<Appointment>({
resourceType: 'Appointment',
resourceId: appointmentId,
});
const statusOperations = getPatchOperationsToUpdateVisitStatus(appointmentToUpdate, 'arrived');

await fhirClient.patchResource({
resourceType: 'Appointment',
resourceId: appointmentId,
operations: [
{
op: 'replace',
path: '/status',
value: 'arrived',
},
const patchOp: Operation = {
op: 'replace',
path: '/status',
value: 'arrived',
};

await fhirClient?.batchRequest({
requests: [
getPatchBinary({
resourceId: appointmentId,
resourceType: 'Appointment',
patchOperations: [patchOp, ...statusOperations],
}),
getPatchBinary({
resourceId: encounterId,
resourceType: 'Encounter',
patchOperations: [patchOp],
}),
],
});
};
Expand Down
13 changes: 0 additions & 13 deletions packages/telemed-ehr/app/src/layout/PageContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Assessment } from '@mui/icons-material';
import { Container, Tooltip, Typography } from '@mui/material';
import { ReactElement, useState } from 'react';
import { Link } from 'react-router-dom';
import { Sidebar, SidebarItem } from '../components/navigation/Sidebar';
import useOttehrUser from '../hooks/useOttehrUser';
import { RoleType } from '../types/types';
Expand Down Expand Up @@ -34,17 +32,6 @@ export default function PageContainer({ sidebarItems, tabTitle, title, children
</Typography>
)}
{children}
<br />
<Typography variant="subtitle2">
Environment: {import.meta.env.VITE_APP_ENV}, Version: {import.meta.env.VITE_APP_VERSION}
{user?.hasRole([RoleType.Administrator]) && (
<Tooltip title="Please remember this is not fully tested :)">
<Link to="/data" style={{ verticalAlign: 'middle' }}>
<Assessment />
</Link>
</Tooltip>
)}
</Typography>
</Container>
);

Expand Down
2 changes: 0 additions & 2 deletions packages/telemed-ehr/app/src/pages/AppointmentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ export const AppointmentPage: FC = () => {
<AppointmentTabs />
</Container>
</Box>

<AppointmentFooter />
</Box>
);
};
13 changes: 13 additions & 0 deletions packages/telemed-ehr/app/src/pages/Version.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Version = (): JSX.Element => {
const { MODE, VITE_APP_SHA, VITE_APP_VERSION } = import.meta.env;

return (
<div>
<p>Env: {MODE}</p>
<p>Hash: {VITE_APP_SHA}</p>
<p>Version: {VITE_APP_VERSION}</p>
</div>
);
};

export default Version;
2 changes: 1 addition & 1 deletion packages/telemed-ehr/zambdas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "telemed-ehrzambdas",
"version": "0.12.0",
"version": "0.13.0",
"private": true,
"scripts": {
"start": "npm run start:local",
Expand Down
3 changes: 2 additions & 1 deletion packages/telemed-ehr/zambdas/src/get-appointments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ const makeAppointmentInformation = (input: AppointmentInformationInputs): UCAppo
}
const encounter = apptRefToEncounterMap[`Appointment/${appointment.id}`];
const questionnaireResponse = encounterRefToQRMap[`Encounter/${encounter?.id}`];

const encounterId = encounter?.id;
let smsModel: SMSModel | undefined;

if (patientRef) {
Expand Down Expand Up @@ -703,5 +703,6 @@ const makeAppointmentInformation = (input: AppointmentInformationInputs): UCAppo
visitStatusHistory: getVisitStatusHistory(appointment),
needsDOBConfirmation: !!unconfirmedDOB,
waitingMinutes,
encounterId: encounterId || '',
};
};
1 change: 0 additions & 1 deletion packages/telemed-ehr/zambdas/src/shared/queueingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class QueueBuilder {
sortAppointments(appointments: Appointment[]): SortedAppointmentQueues {
appointments.forEach((appointment) => {
const status = getStatusLabelForAppointmentAndEncounter(appointment);
console.log(appointment.id, status);
const appointmentType = appointmentTypeForAppointment(appointment);
if (status === 'pending') {
this.insertNew(appointment, this.queues.prebooked);
Expand Down
1 change: 0 additions & 1 deletion packages/telemed-intake/app/env/.env.local-template
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ VITE_APP_WAITING_ROOM_DISABLED=false
VITE_APP_MIXPANEL_TOKEN=
VITE_APP_SENTRY_DSN=
SENTRY_AUTH_TOKEN=
DEFAULT_PATH='location/ak/in-person/prebook'
THEME_PATH='/src/theme/ottehr'
4 changes: 2 additions & 2 deletions packages/telemed-intake/app/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "telemed-intake-app",
"private": true,
"version": "0.12.0",
"version": "0.13.0",
"type": "module",
"scripts": {
"start:local": "vite",
"build:dev": "tsc && vite build --mode dev",
"build": "tsc && vite build",
"deploy:development": "PREFIX=development CLOUDFRONT_ID=EIYX001DGGQK8 ENV=dev pnpm run ci-deploy-skeleton",
"deploy:development": "ENV=development PREFIX=development CLOUDFRONT_ID=EIYX001DGGQK8 pnpm run ci-deploy-skeleton",
"ci-deploy-skeleton": "ENV=${ENV} VITE_APP_SHA=${GIT_HEAD:-$(git rev-parse --short HEAD)} VITE_APP_VERSION=$(node -pe 'require(\"./package.json\").version') pnpm run build:dev && aws s3 sync build/ s3://telemed.ottehr.com --region us-east-1 --delete && aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths '/*' --region us-east-1"
},
"dependencies": {
Expand Down
18 changes: 6 additions & 12 deletions packages/telemed-intake/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import ConfirmDateOfBirth from './pages/ConfirmDateOfBirth';
import ThankYou from './pages/ThankYou';
import { useTranslation } from 'react-i18next';
import ScheduleSelect from './pages/ScheduleSelect';
import Version from './pages/Version';

const isLowerEnvs =
import.meta.env.MODE === 'dev' ||
Expand Down Expand Up @@ -83,6 +84,8 @@ export class IntakeFlowPageRoute {
static readonly InvitedVideoCall = new IntakeFlowPageRoute('/invited-video-call', <VideoChatPage />);
static readonly ThankYou = new IntakeFlowPageRoute('/thank-you', <ThankYou />);

static readonly Version = new IntakeFlowPageRoute('/version', <Version />);

static readonly IOSPatientPhotosEdit = new IntakeFlowPageRoute('/ios-patient-photos', <IOSPatientPhotosEditPage />);
static readonly IOSPatientManageParticipants = new IntakeFlowPageRoute(
'/ios-manage-participants',
Expand Down Expand Up @@ -110,6 +113,7 @@ function App(): JSX.Element {
<Router>
<ScrollToTop />
<Routes>
<Route path={IntakeFlowPageRoute.Version.path} element={IntakeFlowPageRoute.Version.page} />
<Route path={IntakeFlowPageRoute.AuthPage.path} element={IntakeFlowPageRoute.AuthPage.page} />
<Route path={IntakeFlowPageRoute.Welcome.path} element={IntakeFlowPageRoute.Welcome.page} />
<Route
Expand All @@ -129,18 +133,8 @@ function App(): JSX.Element {
/>
}
>
<Route path="/" element={<AuthPage />} />
<Route path={IntakeFlowPageRoute.PatientPortal.path} element={IntakeFlowPageRoute.PatientPortal.page} />
</Route>
<Route
element={
<ProtectedRoute
loadingFallback={<LoadingScreen />}
errorFallback={<ErrorFallbackScreen />}
unauthorizedFallback={<Navigate to={IntakeFlowPageRoute.PatientPortal.path} />}
/>
}
>
<Route path="/" element={<PatientPortal />} />
<Route path={IntakeFlowPageRoute.NewUser.path} element={IntakeFlowPageRoute.NewUser.page} />
<Route path={IntakeFlowPageRoute.ScheduleSelect.path} element={IntakeFlowPageRoute.ScheduleSelect.page} />
<Route path={IntakeFlowPageRoute.SelectPatient.path} element={IntakeFlowPageRoute.SelectPatient.page} />
Expand Down Expand Up @@ -181,7 +175,7 @@ function App(): JSX.Element {
element={IntakeFlowPageRoute.IOSVideoCallMenu.page}
/>
<Route path={IntakeFlowPageRoute.ThankYou.path} element={IntakeFlowPageRoute.ThankYou.page} />
{/* <Route path="*" element={<Navigate to={IntakeFlowPageRoute.Welcome.path} />} /> */}
<Route path="*" element={<Navigate to={IntakeFlowPageRoute.PatientPortal.path} />} />
</Routes>
</Router>
</IntakeThemeProvider>
Expand Down
Loading

0 comments on commit 549d8cb

Please sign in to comment.