├── screenshot.png
├── src
├── pages
│ ├── MessageTablePage.module.css
│ ├── SignOutPage.tsx
│ ├── ObservationPage.tsx
│ ├── health-record
│ │ ├── LabResult.tsx
│ │ ├── Vaccine.tsx
│ │ ├── Vitals.tsx
│ │ ├── index.tsx
│ │ ├── LabResults.tsx
│ │ ├── Medications.tsx
│ │ ├── Responses.tsx
│ │ ├── Response.tsx
│ │ ├── Medication.tsx
│ │ ├── Measurement.data.ts
│ │ ├── Vaccines.tsx
│ │ └── Measurement.tsx
│ ├── care-plan
│ │ ├── index.tsx
│ │ ├── ActionItem.tsx
│ │ └── ActionItems.tsx
│ ├── account
│ │ ├── index.tsx
│ │ ├── Provider.tsx
│ │ ├── MembershipAndBilling.tsx
│ │ └── Profile.tsx
│ ├── SignInPage.tsx
│ ├── RegisterPage.tsx
│ ├── GetCarePage.tsx
│ ├── HomePage.module.css
│ ├── MessageTablePage.tsx
│ ├── landing
│ │ ├── Header.module.css
│ │ ├── index.module.css
│ │ ├── index.tsx
│ │ └── Header.tsx
│ ├── QuestionnairePage.tsx
│ ├── MessagesPage.tsx
│ ├── HomePage.tsx
│ └── PatientIntakeQuestionnairePage.tsx
├── img
│ ├── favicon.ico
│ ├── homePage
│ │ ├── people-talk.jpg
│ │ ├── health-visit.jpg
│ │ ├── hero-background.jpg
│ │ ├── task-icon.svg
│ │ ├── medplum.svg
│ │ ├── health-record.svg
│ │ ├── pill.svg
│ │ ├── better-sleep.svg
│ │ ├── doctor.svg
│ │ └── pharmacy.svg
│ ├── landingPage
│ │ ├── doctor.jpg
│ │ ├── laboratory.jpg
│ │ ├── engineering.jpg
│ │ └── working-environment.jpg
│ ├── pills.svg
│ └── avatar-placeholder.svg
├── vite-env.d.ts
├── components
│ ├── Footer.module.css
│ ├── Loading.tsx
│ ├── InfoSection.module.css
│ ├── InfoButton.module.css
│ ├── InfoButton.tsx
│ ├── InfoSection.tsx
│ ├── SideMenu.module.css
│ ├── Footer.tsx
│ ├── LineChart.tsx
│ ├── SideMenu.tsx
│ ├── Header.module.css
│ ├── Header.tsx
│ └── Logo.tsx
├── config.ts
├── App.test.tsx
├── test.setup.ts
├── App.tsx
├── main.tsx
└── Router.tsx
├── .gitattributes
├── babel.config.json
├── vercel.json
├── vite.config.ts
├── .gitignore
├── index.html
├── tsconfig.json
├── postcss.config.mjs
├── jest.config.json
├── package.json
├── README.md
└── LICENSE.txt
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/screenshot.png
--------------------------------------------------------------------------------
/src/pages/MessageTablePage.module.css:
--------------------------------------------------------------------------------
1 | .tableBody {
2 | cursor: pointer;
3 | }
4 |
--------------------------------------------------------------------------------
/src/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/favicon.ico
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | package-lock.json -diff
3 | package-lock.json linguist-generated=true
4 |
--------------------------------------------------------------------------------
/src/img/homePage/people-talk.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/homePage/people-talk.jpg
--------------------------------------------------------------------------------
/src/img/landingPage/doctor.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/landingPage/doctor.jpg
--------------------------------------------------------------------------------
/src/img/homePage/health-visit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/homePage/health-visit.jpg
--------------------------------------------------------------------------------
/src/img/landingPage/laboratory.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/landingPage/laboratory.jpg
--------------------------------------------------------------------------------
/src/img/homePage/hero-background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/homePage/hero-background.jpg
--------------------------------------------------------------------------------
/src/img/landingPage/engineering.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/landingPage/engineering.jpg
--------------------------------------------------------------------------------
/src/img/landingPage/working-environment.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medplum/foomedical/HEAD/src/img/landingPage/working-environment.jpg
--------------------------------------------------------------------------------
/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env", ["@babel/preset-react", { "runtime": "automatic" }], "@babel/preset-typescript"]
3 | }
4 |
--------------------------------------------------------------------------------
/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "installCommand": "npm install",
3 | "buildCommand": "npm run build",
4 | "routes": [{ "src": "/[^.]+", "dest": "/", "status": 200 }]
5 | }
6 |
--------------------------------------------------------------------------------
/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | ///
4 |
--------------------------------------------------------------------------------
/src/components/Footer.module.css:
--------------------------------------------------------------------------------
1 | .footer {
2 | background: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-8));
3 | }
4 |
5 | .inner {
6 | background: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-8));
7 | border-top: 1px solid var(--mantine-color-gray-2);
8 | padding: var(--mantine-spacing-xl);
9 | text-align: center;
10 | }
11 |
--------------------------------------------------------------------------------
/vite.config.ts:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import react from '@vitejs/plugin-react';
4 | import { defineConfig } from 'vite';
5 |
6 | // https://vitejs.dev/config/
7 | export default defineConfig({
8 | plugins: [react()],
9 | server: {
10 | port: 3000,
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .env
12 | dist
13 | dist-ssr
14 | *.local
15 | coverage
16 | package-lock.json
17 |
18 | # Editor directories and files
19 | .vscode/*
20 | !.vscode/extensions.json
21 | .idea
22 | .DS_Store
23 | *.suo
24 | *.ntvs*
25 | *.njsproj
26 | *.sln
27 | *.sw?
28 |
--------------------------------------------------------------------------------
/src/components/Loading.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Center, Loader } from '@mantine/core';
4 | import type { JSX } from 'react';
5 |
6 | export function Loading(): JSX.Element {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/src/components/InfoSection.module.css:
--------------------------------------------------------------------------------
1 | .titleSection {
2 | background: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6));
3 | border: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-1));
4 | color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-1));
5 | padding: var(--mantine-spacing-md) var(--mantine-spacing-md);
6 | }
7 |
8 | .title {
9 | font-weight: 500;
10 | }
11 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Foo Medical
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/img/homePage/task-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/config.ts:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | // Default values work on localhost:3000 and foomedical.com
5 | // Replace these values with your own values for production
6 | export const MEDPLUM_PROJECT_ID = '9602358d-eeb0-4de8-bccf-e2438b5c9162';
7 | export const MEDPLUM_GOOGLE_CLIENT_ID = '679052511930-8dqur4mmg8egbttgos5pmr4ljtf3etbb.apps.googleusercontent.com';
8 | export const MEDPLUM_RECAPTCHA_SITE_KEY = '6LfFd_8gAAAAAOCVrZQ_aF2CN5b7s91NEYIu5GxL';
9 |
--------------------------------------------------------------------------------
/src/pages/SignOutPage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { useMedplum } from '@medplum/react';
4 | import { useEffect } from 'react';
5 |
6 | export function SignOutPage(): null {
7 | const medplum = useMedplum();
8 |
9 | useEffect(() => {
10 | medplum
11 | .signOut()
12 | .then(() => {
13 | window.location.href = '/';
14 | })
15 | .catch(console.error);
16 | }, [medplum]);
17 |
18 | return null;
19 | }
20 |
--------------------------------------------------------------------------------
/src/components/InfoButton.module.css:
--------------------------------------------------------------------------------
1 | .button {
2 | color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1));
3 | padding: var(--mantine-spacing-md) var(--mantine-spacing-md);
4 |
5 | &:not(:last-child) {
6 | border-bottom: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-1));
7 | }
8 |
9 | &:hover {
10 | background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
11 | color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
6 | "allowJs": false,
7 | "skipLibCheck": true,
8 | "esModuleInterop": true,
9 | "allowSyntheticDefaultImports": true,
10 | "strict": true,
11 | "forceConsistentCasingInFileNames": true,
12 | "module": "ESNext",
13 | "moduleResolution": "bundler",
14 | "resolveJsonModule": true,
15 | "noEmit": true,
16 | "jsx": "react-jsx"
17 | },
18 | "exclude": ["dist"]
19 | }
20 |
--------------------------------------------------------------------------------
/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import mantinePreset from 'postcss-preset-mantine';
4 | import simpleVars from 'postcss-simple-vars';
5 |
6 | const config = {
7 | plugins: [
8 | mantinePreset(),
9 | simpleVars({
10 | variables: {
11 | 'mantine-breakpoint-xs': '36em',
12 | 'mantine-breakpoint-sm': '48em',
13 | 'mantine-breakpoint-md': '62em',
14 | 'mantine-breakpoint-lg': '75em',
15 | 'mantine-breakpoint-xl': '88em',
16 | },
17 | }),
18 | ],
19 | };
20 |
21 | export default config;
22 |
--------------------------------------------------------------------------------
/src/components/InfoButton.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Group, UnstyledButton } from '@mantine/core';
4 | import type { JSX, ReactNode } from 'react';
5 | import classes from './InfoButton.module.css';
6 |
7 | export interface InfoButtonProps {
8 | readonly onClick?: () => void;
9 | readonly children: ReactNode;
10 | }
11 |
12 | export function InfoButton(props: InfoButtonProps): JSX.Element {
13 | return (
14 |
15 | {props.children}
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/jest.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "testEnvironment": "jsdom",
3 | "testTimeout": 120000,
4 | "transform": {
5 | "^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
6 | ".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
7 | },
8 | "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
9 | "moduleNameMapper": {
10 | "^.+.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
11 | },
12 | "testMatch": ["**/src/**/*.test.ts", "**/src/**/*.test.tsx"],
13 | "setupFilesAfterEnv": ["./src/test.setup.ts"],
14 | "coverageDirectory": "coverage",
15 | "coverageReporters": ["json", "text", "lcov"],
16 | "collectCoverageFrom": ["**/src/**/*"]
17 | }
18 |
--------------------------------------------------------------------------------
/src/pages/ObservationPage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Title } from '@mantine/core';
4 | import { Document, ResourceTable, useMedplum } from '@medplum/react';
5 | import type { JSX } from 'react';
6 | import { useParams } from 'react-router';
7 |
8 | export function ObservationPage(): JSX.Element {
9 | const medplum = useMedplum();
10 | const { observationId = '' } = useParams();
11 | const resource = medplum.readResource('Observation', observationId).read();
12 |
13 | return (
14 |
15 | Observation
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/src/App.test.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { MantineProvider } from '@mantine/core';
4 | import { MockClient } from '@medplum/mock';
5 | import { MedplumProvider } from '@medplum/react';
6 | import { act, render } from '@testing-library/react';
7 | import { MemoryRouter } from 'react-router';
8 | import { App } from './App';
9 |
10 | test('App renders', async () => {
11 | await act(async () => {
12 | render(
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | );
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/src/pages/health-record/LabResult.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box } from '@mantine/core';
4 | import type { DiagnosticReport } from '@medplum/fhirtypes';
5 | import { DiagnosticReportDisplay, useMedplum } from '@medplum/react';
6 | import type { JSX } from 'react';
7 | import { useParams } from 'react-router';
8 | import { InfoSection } from '../../components/InfoSection';
9 |
10 | export function LabResult(): JSX.Element {
11 | const medplum = useMedplum();
12 | const { resultId = '' } = useParams();
13 | const resource: DiagnosticReport = medplum.readResource('DiagnosticReport', resultId).read();
14 |
15 | return (
16 |
17 |
18 |
19 |
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/src/pages/care-plan/index.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Container, Group } from '@mantine/core';
4 | import { Suspense } from 'react';
5 | import type { JSX } from 'react';
6 | import { Outlet } from 'react-router';
7 | import { Loading } from '../../components/Loading';
8 | import { SideMenu } from '../../components/SideMenu';
9 |
10 | const sideMenu = {
11 | title: 'Care Plan',
12 | menu: [{ name: 'Action Items', href: '/care-plan/action-items' }],
13 | };
14 |
15 | export function CarePlanPage(): JSX.Element {
16 | return (
17 |
18 |
19 |
20 |
21 | }>
22 |
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/care-plan/ActionItem.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Title } from '@mantine/core';
4 | import type { CarePlan } from '@medplum/fhirtypes';
5 | import { ResourceTable, useMedplum } from '@medplum/react';
6 | import type { JSX } from 'react';
7 | import { useParams } from 'react-router';
8 | import { InfoSection } from '../../components/InfoSection';
9 |
10 | export function ActionItem(): JSX.Element {
11 | const medplum = useMedplum();
12 | const { itemId } = useParams();
13 | const resource: CarePlan = medplum.readResource('CarePlan', itemId as string).read();
14 |
15 | return (
16 |
17 |
18 | {resource.title}
19 |
20 |
21 |
22 |
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/src/test.setup.ts:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import '@testing-library/jest-dom';
4 | import { TextDecoder, TextEncoder } from 'node:util';
5 |
6 | Object.defineProperty(globalThis.window, 'TextDecoder', { value: TextDecoder });
7 | Object.defineProperty(globalThis.window, 'TextEncoder', { value: TextEncoder });
8 |
9 | Object.defineProperty(window, 'matchMedia', {
10 | writable: true,
11 | value: jest.fn().mockImplementation((query) => ({
12 | matches: false,
13 | media: query,
14 | onchange: null,
15 | addListener: jest.fn(),
16 | removeListener: jest.fn(),
17 | addEventListener: jest.fn(),
18 | removeEventListener: jest.fn(),
19 | dispatchEvent: jest.fn(),
20 | })),
21 | });
22 |
23 | class ResizeObserver {
24 | observe(): void {}
25 | unobserve(): void {}
26 | disconnect(): void {}
27 | }
28 |
29 | window.ResizeObserver = ResizeObserver;
30 |
--------------------------------------------------------------------------------
/src/pages/health-record/Vaccine.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Title } from '@mantine/core';
4 | import type { Immunization } from '@medplum/fhirtypes';
5 | import { ResourceTable, useMedplum } from '@medplum/react';
6 | import type { JSX } from 'react';
7 | import { useParams } from 'react-router';
8 | import { InfoSection } from '../../components/InfoSection';
9 |
10 | export function Vaccine(): JSX.Element {
11 | const medplum = useMedplum();
12 | const { vaccineId = '' } = useParams();
13 | const vaccine: Immunization = medplum.readResource('Immunization', vaccineId).read();
14 |
15 | return (
16 |
17 |
18 | {vaccine.vaccineCode?.text}
19 |
20 |
21 |
22 |
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/src/pages/account/index.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Container, Group } from '@mantine/core';
4 | import { Suspense } from 'react';
5 | import type { JSX } from 'react';
6 | import { Outlet } from 'react-router';
7 | import { SideMenu } from '../../components/SideMenu';
8 |
9 | const sideMenu = {
10 | title: 'Account',
11 | menu: [
12 | { name: 'Profile', href: '/account/profile' },
13 | { name: 'Provider', href: '/account/provider' },
14 | { name: 'Membership & Billing', href: '/account/membership-and-billing' },
15 | ],
16 | };
17 |
18 | export function AccountPage(): JSX.Element {
19 | return (
20 |
21 |
22 |
23 |
24 | Loading...
}>
25 |
26 |
27 |
28 |
29 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/src/pages/SignInPage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { BackgroundImage, Box, SimpleGrid } from '@mantine/core';
4 | import { SignInForm } from '@medplum/react';
5 | import type { JSX } from 'react';
6 | import { useNavigate } from 'react-router';
7 | import { MEDPLUM_GOOGLE_CLIENT_ID, MEDPLUM_PROJECT_ID } from '../config';
8 |
9 | export function SignInPage(): JSX.Element {
10 | const navigate = useNavigate();
11 | return (
12 |
13 |
14 | navigate('/')?.catch(console.error)}
18 | >
19 | Sign in to Foo Medical
20 |
21 |
22 |
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/src/components/InfoSection.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Card, CloseButton, Title } from '@mantine/core';
4 | import type { JSX, ReactNode } from 'react';
5 | import classes from './InfoSection.module.css';
6 |
7 | interface InfoSectionProps {
8 | readonly title?: string | JSX.Element;
9 | readonly children: ReactNode;
10 | readonly onButtonClick?: (id: string) => void;
11 | readonly resourceType?: string;
12 | readonly id?: string;
13 | }
14 |
15 | export function InfoSection({ title, children, onButtonClick, id = '' }: InfoSectionProps): JSX.Element {
16 | return (
17 |
18 | {title && (
19 |
20 |
21 | {title}
22 |
23 | {onButtonClick && onButtonClick(id)} />}
24 |
25 | )}
26 | {children}
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/src/components/SideMenu.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | flex: 200;
3 | width: 200px;
4 | padding-top: 32px;
5 | }
6 |
7 | .title {
8 | font-weight: 500;
9 | margin-bottom: 8px;
10 | }
11 |
12 | .link {
13 | display: flex;
14 | align-items: center;
15 | text-decoration: none;
16 | font-size: var(--mantine-font-size-sm);
17 | color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1));
18 | padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
19 | border-radius: var(--mantine-radius-sm);
20 | font-weight: 500;
21 |
22 | &:hover {
23 | background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-8));
24 | color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
25 | }
26 | }
27 |
28 | .linkIcon {
29 | color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2));
30 | margin-right: var(--mantine-spacing-sm);
31 | }
32 |
33 | .linkActive,
34 | .linkActive:hover {
35 | background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-7));
36 | color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
37 | }
38 |
--------------------------------------------------------------------------------
/src/pages/RegisterPage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { BackgroundImage, Box, SimpleGrid } from '@mantine/core';
4 | import { RegisterForm } from '@medplum/react';
5 | import type { JSX } from 'react';
6 | import { useNavigate } from 'react-router';
7 | import { MEDPLUM_GOOGLE_CLIENT_ID, MEDPLUM_PROJECT_ID, MEDPLUM_RECAPTCHA_SITE_KEY } from '../config';
8 |
9 | export function RegisterPage(): JSX.Element {
10 | const navigate = useNavigate();
11 | return (
12 |
13 |
14 | navigate('/')?.catch(console.error)}
20 | >
21 | Register with Foo Medical
22 |
23 |
24 |
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/src/img/homePage/medplum.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/components/Footer.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Anchor, Container, Divider, SimpleGrid, Stack, Text } from '@mantine/core';
4 | import type { JSX } from 'react';
5 | import classes from './Footer.module.css';
6 |
7 | export function Footer(): JSX.Element {
8 | return (
9 |
10 |
11 |
12 |
13 |
14 | Getting started
15 | Playing with Medplum
16 | Open Source
17 | Documentation
18 |
19 |
20 |
21 | © {new Date().getFullYear()} Foo Medical, Inc. All rights reserved.
22 |
23 |
24 |
25 |
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/src/components/LineChart.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import type { ChartData } from 'chart.js';
4 | import { lazy, Suspense } from 'react';
5 | import type { JSX } from 'react';
6 |
7 | const lineChartOptions = {
8 | responsive: true,
9 | scales: {
10 | y: {
11 | min: 0,
12 | },
13 | },
14 | plugins: {
15 | legend: {
16 | position: 'bottom' as const,
17 | },
18 | },
19 | };
20 |
21 | interface LineChartProps {
22 | readonly chartData: ChartData<'line', number[]>;
23 | }
24 |
25 | const AsyncLine = lazy(async () => {
26 | const { CategoryScale, Chart, Legend, LinearScale, LineElement, PointElement, Title, Tooltip } =
27 | await import('chart.js');
28 | Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend);
29 | const { Line } = await import('react-chartjs-2');
30 | return { default: Line };
31 | });
32 |
33 | export function LineChart({ chartData }: LineChartProps): JSX.Element {
34 | return (
35 |
36 | Loading...
}>
37 |
38 |
39 |
40 | );
41 | }
42 |
--------------------------------------------------------------------------------
/src/pages/GetCarePage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import type { Schedule } from '@medplum/fhirtypes';
4 | import { Document, Scheduler, useMedplum } from '@medplum/react';
5 | import type { JSX } from 'react';
6 |
7 | export function GetCare(): JSX.Element {
8 | const medplum = useMedplum();
9 | const schedule = medplum.searchOne('Schedule').read();
10 |
11 | return (
12 |
13 |
41 |
42 | );
43 | }
44 |
--------------------------------------------------------------------------------
/src/pages/health-record/Vitals.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Table, Title } from '@mantine/core';
4 | import { formatDate, formatObservationValue, getReferenceString } from '@medplum/core';
5 | import type { Patient } from '@medplum/fhirtypes';
6 | import { Document, useMedplum } from '@medplum/react';
7 | import type { JSX } from 'react';
8 |
9 | export function Vitals(): JSX.Element {
10 | const medplum = useMedplum();
11 | const patient = medplum.getProfile() as Patient;
12 | const observations = medplum.searchResources('Observation', 'patient=' + getReferenceString(patient)).read();
13 |
14 | return (
15 |
16 | Vitals
17 |
18 |
19 |
20 | Measurement
21 | Your Value
22 | Last Updated
23 |
24 |
25 |
26 | {observations.map((obs) => (
27 |
28 | {obs.code?.coding?.[0]?.display}
29 | {formatObservationValue(obs)}
30 | {formatDate(obs.meta?.lastUpdated)}
31 |
32 | ))}
33 |
34 |
35 |
36 | );
37 | }
38 |
--------------------------------------------------------------------------------
/src/pages/account/Provider.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Button, Stack, Title } from '@mantine/core';
4 | import type { Patient } from '@medplum/fhirtypes';
5 | import { ResourceAvatar, ResourceName, useMedplum } from '@medplum/react';
6 | import type { JSX } from 'react';
7 | import { InfoSection } from '../../components/InfoSection';
8 |
9 | export function Provider(): JSX.Element {
10 | const medplum = useMedplum();
11 | const patient = medplum.getProfile() as Patient;
12 |
13 | if (patient.generalPractitioner && patient.generalPractitioner.length > 0) {
14 | return (
15 |
16 | My Provider
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Choose a Primary Care Provider
25 |
26 |
27 |
28 |
29 | );
30 | }
31 |
32 | return (
33 |
34 | Choose a provider
35 | TODO
36 |
37 | );
38 | }
39 |
--------------------------------------------------------------------------------
/src/components/SideMenu.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Title } from '@mantine/core';
4 | import cx from 'clsx';
5 | import { Fragment } from 'react';
6 | import type { JSX } from 'react';
7 | import { NavLink } from 'react-router';
8 | import classes from './SideMenu.module.css';
9 |
10 | export interface SubMenuProps {
11 | readonly name: string;
12 | readonly href: string;
13 | }
14 |
15 | export interface SideMenuProps {
16 | readonly title: string;
17 | readonly menu: { name: string; href: string; subMenu?: SubMenuProps[] }[];
18 | }
19 |
20 | export function SideMenu(props: SideMenuProps): JSX.Element {
21 | return (
22 |
23 |
24 | {props.title}
25 |
26 | {props.menu.map((item) => (
27 |
28 | cx(classes.link, isActive && classes.linkActive)}>
29 | {item.name}
30 |
31 | {item.subMenu?.map((subItem) => (
32 |
33 |
34 | {subItem.name}
35 |
36 |
37 | ))}
38 |
39 | ))}
40 |
41 | );
42 | }
43 |
--------------------------------------------------------------------------------
/src/pages/health-record/index.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Container, Group } from '@mantine/core';
4 | import { Suspense } from 'react';
5 | import type { JSX } from 'react';
6 | import { Outlet } from 'react-router';
7 | import { Loading } from '../../components/Loading';
8 | import { SideMenu } from '../../components/SideMenu';
9 | import { measurementsMeta } from './Measurement.data';
10 |
11 | const sideMenu = {
12 | title: 'Health Record',
13 | menu: [
14 | { name: 'Lab Results', href: '/health-record/lab-results' },
15 | { name: 'Medications', href: '/health-record/medications' },
16 | { name: 'Questionnaire Responses', href: '/health-record/questionnaire-responses' },
17 | { name: 'Vaccines', href: '/health-record/vaccines' },
18 | {
19 | name: 'Vitals',
20 | href: '/health-record/vitals',
21 | subMenu: Object.values(measurementsMeta).map(({ title, id }) => ({
22 | name: title,
23 | href: `/health-record/vitals/${id}`,
24 | })),
25 | },
26 | ],
27 | };
28 |
29 | export function HealthRecord(): JSX.Element {
30 | return (
31 |
32 |
33 |
34 |
35 | }>
36 |
37 |
38 |
39 |
40 |
41 | );
42 | }
43 |
--------------------------------------------------------------------------------
/src/App.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { AppShell } from '@mantine/core';
4 | import { ErrorBoundary, useMedplum } from '@medplum/react';
5 | import { Suspense } from 'react';
6 | import type { JSX } from 'react';
7 | import { Navigate, Route, Routes } from 'react-router';
8 | import { Router } from './Router';
9 | import { Footer } from './components/Footer';
10 | import { Header } from './components/Header';
11 | import { Loading } from './components/Loading';
12 | import { RegisterPage } from './pages/RegisterPage';
13 | import { SignInPage } from './pages/SignInPage';
14 | import { LandingPage } from './pages/landing';
15 |
16 | export function App(): JSX.Element | null {
17 | const medplum = useMedplum();
18 |
19 | if (medplum.isLoading()) {
20 | return null;
21 | }
22 |
23 | if (!medplum.getProfile()) {
24 | return (
25 |
26 | } />
27 | } />
28 | } />
29 | } />
30 |
31 | );
32 | }
33 |
34 | return (
35 |
36 |
37 |
38 |
39 | }>
40 |
41 |
42 |
43 |
44 |
45 |
46 | );
47 | }
48 |
--------------------------------------------------------------------------------
/src/main.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { MantineProvider, createTheme } from '@mantine/core';
4 | import '@mantine/core/styles.css';
5 | import { Notifications } from '@mantine/notifications';
6 | import '@mantine/notifications/styles.css';
7 | import { MedplumClient } from '@medplum/core';
8 | import { MedplumProvider } from '@medplum/react';
9 | import '@medplum/react/styles.css';
10 | import { StrictMode } from 'react';
11 | import { createRoot } from 'react-dom/client';
12 | import { BrowserRouter } from 'react-router';
13 | import { App } from './App';
14 |
15 | const medplum = new MedplumClient({
16 | // To run FooMedical locally, you can set the baseURL in this constructor
17 | // baseUrl: http://localhost:8103
18 | onUnauthenticated: () => (window.location.href = '/'),
19 | });
20 |
21 | const theme = createTheme({
22 | primaryColor: 'teal',
23 | primaryShade: 8,
24 | fontSizes: {
25 | xs: '0.6875rem',
26 | sm: '0.875rem',
27 | md: '0.875rem',
28 | lg: '1rem',
29 | xl: '1.125rem',
30 | },
31 | components: {
32 | Container: {
33 | defaultProps: {
34 | size: 1200,
35 | },
36 | },
37 | },
38 | });
39 |
40 | const root = createRoot(document.getElementById('root') as HTMLElement);
41 | root.render(
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | );
53 |
--------------------------------------------------------------------------------
/src/pages/HomePage.module.css:
--------------------------------------------------------------------------------
1 | /* Announcements */
2 | .announcements {
3 | background-color: var(--mantine-primary-color-light);
4 | padding: var(--mantine-spacing-xs);
5 | text-align: center;
6 | }
7 |
8 | /* Hero */
9 | .hero {
10 | position: relative;
11 | background-image: url('../img/homePage/hero-background.jpg');
12 | background-size: cover;
13 | background-position: center;
14 | }
15 |
16 | .heroContainer {
17 | height: 400px;
18 | display: flex;
19 | flex-direction: column;
20 | justify-content: flex-end;
21 | align-items: flex-start;
22 | padding-top: 4.5rem;
23 | padding-bottom: 6rem;
24 | z-index: 1;
25 | position: relative;
26 |
27 | @mixin smaller-than $mantine-breakpoint-sm {
28 | padding-top: 3rem;
29 | padding-bottom: 4.5rem;
30 | }
31 | }
32 |
33 | .heroTitle {
34 | color: var(--mantine-color-white);
35 | font-size: 50px;
36 | font-weight: 500;
37 | line-height: 1.2;
38 |
39 | @mixin smaller-than $mantine-breakpoint-sm {
40 | font-size: 30px;
41 | line-height: 1.2;
42 | }
43 |
44 | @mixin smaller-than $mantine-breakpoint-xs {
45 | font-size: 28px;
46 | line-height: 1.3;
47 | }
48 | }
49 |
50 | .heroButton {
51 | margin-top: 2.25rem;
52 |
53 | @mixin smaller-than $mantine-breakpoint-sm {
54 | width: 100px;
55 | }
56 | }
57 |
58 | /* Call to action */
59 | .callToAction {
60 | background-color: var(--mantine-primary-color-filled);
61 | color: var(--mantine-color-white);
62 | padding: var(--mantine-spacing-md);
63 | text-align: center;
64 | }
65 |
66 | /* Task cards */
67 | .card {
68 | border: 1px solid light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
69 | }
70 |
--------------------------------------------------------------------------------
/src/pages/health-record/LabResults.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Stack, Text, Title, useMantineTheme } from '@mantine/core';
4 | import { formatDate, getReferenceString } from '@medplum/core';
5 | import type { Patient } from '@medplum/fhirtypes';
6 | import { useMedplum } from '@medplum/react';
7 | import { IconChevronRight } from '@tabler/icons-react';
8 | import type { JSX } from 'react';
9 | import { useNavigate } from 'react-router';
10 | import { InfoButton } from '../../components/InfoButton';
11 | import { InfoSection } from '../../components/InfoSection';
12 |
13 | export function LabResults(): JSX.Element {
14 | const theme = useMantineTheme();
15 | const navigate = useNavigate();
16 | const medplum = useMedplum();
17 | const patient = medplum.getProfile() as Patient;
18 | const reports = medplum.searchResources('DiagnosticReport', 'subject=' + getReferenceString(patient)).read();
19 |
20 | return (
21 |
22 | Lab Results
23 |
24 |
25 | {reports.map((report) => (
26 | navigate(`./${report.id}`)?.catch(console.error)}>
27 |
28 |
29 | {formatDate(report.meta?.lastUpdated as string)}
30 |
31 | {report.code?.text}
32 |
33 |
34 |
35 | ))}
36 |
37 |
38 |
39 | );
40 | }
41 |
--------------------------------------------------------------------------------
/src/pages/health-record/Medications.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Stack, Text, Title, useMantineTheme } from '@mantine/core';
4 | import { getReferenceString } from '@medplum/core';
5 | import type { Patient } from '@medplum/fhirtypes';
6 | import { useMedplum } from '@medplum/react';
7 | import { IconChevronRight } from '@tabler/icons-react';
8 | import type { JSX } from 'react';
9 | import { useNavigate } from 'react-router';
10 | import { InfoButton } from '../../components/InfoButton';
11 | import { InfoSection } from '../../components/InfoSection';
12 |
13 | export function Medications(): JSX.Element {
14 | const theme = useMantineTheme();
15 | const navigate = useNavigate();
16 | const medplum = useMedplum();
17 | const patient = medplum.getProfile() as Patient;
18 | const medications = medplum.searchResources('MedicationRequest', 'patient=' + getReferenceString(patient)).read();
19 |
20 | return (
21 |
22 | Medications
23 |
24 |
25 | {medications.map((med) => (
26 | navigate(`./${med.id}`)?.catch(console.error)}>
27 |
28 |
29 | {med?.medicationCodeableConcept?.text}
30 |
31 | {med.requester?.display}
32 |
33 |
34 |
35 | ))}
36 |
37 |
38 |
39 | );
40 | }
41 |
--------------------------------------------------------------------------------
/src/pages/health-record/Responses.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Stack, Text, Title, useMantineTheme } from '@mantine/core';
4 | import { formatDateTime, getReferenceString } from '@medplum/core';
5 | import type { Patient } from '@medplum/fhirtypes';
6 | import { useMedplum, useMedplumProfile } from '@medplum/react';
7 | import { IconChevronRight } from '@tabler/icons-react';
8 | import type { JSX } from 'react';
9 | import { useNavigate } from 'react-router';
10 | import { InfoButton } from '../../components/InfoButton';
11 | import { InfoSection } from '../../components/InfoSection';
12 |
13 | export function Responses(): JSX.Element {
14 | const medplum = useMedplum();
15 | const theme = useMantineTheme();
16 | const navigate = useNavigate();
17 | const profile = useMedplumProfile() as Patient;
18 | const responses = medplum
19 | .searchResources('QuestionnaireResponse', `source=${getReferenceString(profile)}&_sort=-authored`)
20 | .read();
21 |
22 | return (
23 |
24 | Questionnaire Responses
25 |
26 |
27 | {responses.map((resp) => (
28 | navigate(`./${resp.id}`)?.catch(console.error)}>
29 |
30 |
31 | {formatDateTime(resp.authored)}
32 |
33 |
34 |
35 |
36 | ))}
37 |
38 |
39 |
40 | );
41 | }
42 |
--------------------------------------------------------------------------------
/src/pages/MessageTablePage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Divider, Stack, Table, Title } from '@mantine/core';
4 | import { formatFamilyName, formatGivenName } from '@medplum/core';
5 | import type { HumanName } from '@medplum/fhirtypes';
6 | import { Document, useSearchResources } from '@medplum/react';
7 | import type { JSX } from 'react';
8 | import { useNavigate } from 'react-router';
9 | import { Loading } from '../components/Loading';
10 | import classes from './MessageTablePage.module.css';
11 |
12 | export function MessageTable(): JSX.Element {
13 | const [practitioners] = useSearchResources('Practitioner');
14 | const navigate = useNavigate();
15 |
16 | if (!practitioners) {
17 | return ;
18 | }
19 |
20 | return (
21 |
22 | Chats
23 |
24 |
25 |
26 |
27 |
28 | Name
29 |
30 |
31 |
32 | {practitioners.map((resource) => (
33 | navigate(`/messages/${resource.id}`)?.catch(console.error)}
37 | >
38 |
39 | {formatGivenName(resource.name?.[0] as HumanName)} {formatFamilyName(resource.name?.[0] as HumanName)}
40 |
41 |
42 | ))}
43 |
44 |
45 |
46 |
47 | );
48 | }
49 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "foomedical",
3 | "version": "5.0.10",
4 | "type": "module",
5 | "scripts": {
6 | "build": "tsc && vite build",
7 | "coverage": "jest --coverage",
8 | "dev": "vite",
9 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix src",
10 | "preview": "vite preview",
11 | "test": "jest"
12 | },
13 | "prettier": {
14 | "printWidth": 120,
15 | "singleQuote": true,
16 | "trailingComma": "es5"
17 | },
18 | "devDependencies": {
19 | "@babel/core": "7.28.5",
20 | "@babel/preset-env": "7.28.5",
21 | "@babel/preset-react": "7.28.5",
22 | "@babel/preset-typescript": "7.28.5",
23 | "@mantine/core": "8.3.10",
24 | "@mantine/hooks": "8.3.10",
25 | "@mantine/notifications": "8.3.10",
26 | "@medplum/core": "5.0.10",
27 | "@medplum/eslint-config": "5.0.10",
28 | "@medplum/fhirtypes": "5.0.10",
29 | "@medplum/mock": "5.0.10",
30 | "@medplum/react": "5.0.10",
31 | "@tabler/icons-react": "3.35.0",
32 | "@testing-library/jest-dom": "6.9.1",
33 | "@testing-library/react": "16.3.0",
34 | "@types/jest": "30.0.0",
35 | "@types/node": "22.19.2",
36 | "@types/react": "19.2.7",
37 | "@types/react-dom": "19.2.3",
38 | "@vitejs/plugin-react": "5.1.2",
39 | "babel-jest": "30.2.0",
40 | "c8": "10.1.3",
41 | "chart.js": "4.5.1",
42 | "fast-json-patch": "3.1.1",
43 | "jest": "30.2.0",
44 | "jest-environment-jsdom": "30.2.0",
45 | "jest-transform-stub": "2.0.0",
46 | "postcss": "8.5.6",
47 | "postcss-preset-mantine": "1.18.0",
48 | "react": "19.2.3",
49 | "react-chartjs-2": "5.3.1",
50 | "react-dom": "19.2.3",
51 | "react-router": "7.10.1",
52 | "typescript": "5.9.3",
53 | "vite": "7.2.7"
54 | },
55 | "packageManager": "npm@10.9.4",
56 | "engines": {
57 | "node": "^22.18.0 || >=24.2.0"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/img/homePage/health-record.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
9 |
11 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/src/components/Header.module.css:
--------------------------------------------------------------------------------
1 | .inner {
2 | height: 80px;
3 | display: flex;
4 | justify-content: space-between;
5 | align-items: center;
6 | }
7 |
8 | .logoButton {
9 | padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
10 | border-radius: var(--mantine-radius-sm);
11 | transition: background-color 100ms ease;
12 |
13 | &:hover {
14 | background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
15 | color: light-dark(var(--mantine-color-dark), var(--mantine-color-light));
16 | }
17 | }
18 |
19 | .links {
20 | @mixin smaller-than $mantine-breakpoint-sm {
21 | display: none;
22 | }
23 | }
24 |
25 | .burger {
26 | @mixin larger-than $mantine-breakpoint-sm {
27 | display: none;
28 | }
29 | }
30 |
31 | .link {
32 | display: block;
33 | line-height: 1px;
34 | padding: 8px 12px;
35 | border-radius: var(--mantine-radius-sm);
36 | text-decoration: none;
37 | color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-0));
38 | font-size: var(--mantine-font-size-lg);
39 | font-weight: 500;
40 |
41 | &:hover {
42 | background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
43 | }
44 | }
45 |
46 | .linkLabel {
47 | margin-right: 5px;
48 | }
49 |
50 | .user {
51 | color: light-dark(var(--mantine-color-black), var(--mantine-color-dark-0));
52 | padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
53 | border-radius: var(--mantine-radius-sm);
54 | transition: background-color 100ms ease;
55 |
56 | &:hover {
57 | background-color: light-dark(var(--mantine-color-white), var(--mantine-color-dark-8));
58 | }
59 |
60 | @mixin smaller-than $mantine-breakpoint-xs {
61 | display: none;
62 | }
63 | }
64 |
65 | .userActive {
66 | background-color: light-dark(var(--mantine-color-white), var(--mantine-color-dark-8));
67 | }
68 |
--------------------------------------------------------------------------------
/src/pages/landing/Header.module.css:
--------------------------------------------------------------------------------
1 | .logoButton {
2 | padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
3 | border-radius: var(--mantine-radius-sm);
4 | transition: background-color 100ms ease;
5 |
6 | &:hover {
7 | background-color: var(--mantine-primary-color-light-hover);
8 | }
9 | }
10 |
11 | .link {
12 | display: flex;
13 | align-items: center;
14 | padding-left: var(--mantine-spacing-md);
15 | padding-right: var(--mantine-spacing-md);
16 | text-decoration: none;
17 | color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
18 | font-weight: 500;
19 | font-size: var(--mantine-font-size-xl);
20 |
21 | @media (max-width: $mantine-breakpoint-sm) {
22 | height: rem(42px);
23 | width: 100%;
24 | }
25 |
26 | @mixin hover {
27 | background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
28 | }
29 | }
30 |
31 | .subLink {
32 | width: 100%;
33 | padding: var(--mantine-spacing-xs) var(--mantine-spacing-md);
34 | border-radius: var(--mantine-radius-md);
35 |
36 | @mixin hover {
37 | background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-7));
38 | }
39 | }
40 |
41 | .dropdownFooter {
42 | background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-7));
43 | margin: calc(var(--mantine-spacing-md) * -1);
44 | margin-top: var(--mantine-spacing-sm);
45 | padding: var(--mantine-spacing-md) calc(var(--mantine-spacing-md) * 2);
46 | padding-bottom: var(--mantine-spacing-xl);
47 | border-top: rem(1px) solid light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
48 | }
49 |
50 | .hiddenMobile {
51 | @media (max-width: $mantine-breakpoint-sm) {
52 | display: none;
53 | }
54 | }
55 |
56 | .hiddenDesktop {
57 | @media (min-width: $mantine-breakpoint-sm) {
58 | display: none;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/img/homePage/pill.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
13 |
15 |
17 |
19 |
21 |
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/pages/care-plan/ActionItems.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Stack, Text, Title, useMantineTheme } from '@mantine/core';
4 | import { formatDate, getReferenceString } from '@medplum/core';
5 | import type { Patient } from '@medplum/fhirtypes';
6 | import { StatusBadge, useMedplum } from '@medplum/react';
7 | import { IconCalendar } from '@tabler/icons-react';
8 | import type { JSX } from 'react';
9 | import { useNavigate } from 'react-router';
10 | import { InfoButton } from '../../components/InfoButton';
11 | import { InfoSection } from '../../components/InfoSection';
12 |
13 | export function ActionItems(): JSX.Element {
14 | const theme = useMantineTheme();
15 | const navigate = useNavigate();
16 | const medplum = useMedplum();
17 | const patient = medplum.getProfile() as Patient;
18 | const carePlans = medplum.searchResources('CarePlan', 'subject=' + getReferenceString(patient)).read();
19 |
20 | return (
21 |
22 | Action Items
23 |
24 |
25 | {carePlans.map((resource) => (
26 | navigate(`./${resource.id}`)?.catch(console.error)}>
27 |
28 |
29 | {resource.title}
30 |
31 |
32 |
33 | {formatDate(resource.period?.start)}
34 | {resource.period?.end && - {formatDate(resource.period.end)} }
35 |
36 |
37 |
38 |
39 | ))}
40 |
41 |
42 |
43 | );
44 | }
45 |
--------------------------------------------------------------------------------
/src/pages/QuestionnairePage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { showNotification } from '@mantine/notifications';
4 | import { normalizeErrorString } from '@medplum/core';
5 | import type { Questionnaire, QuestionnaireResponse } from '@medplum/fhirtypes';
6 | import { Document, QuestionnaireForm, useMedplum, useResource } from '@medplum/react';
7 | import { IconCircleCheck, IconCircleOff } from '@tabler/icons-react';
8 | import { useCallback } from 'react';
9 | import type { JSX } from 'react';
10 | import { useNavigate, useParams } from 'react-router';
11 | import { Loading } from '../components/Loading';
12 |
13 | export function QuestionnairePage(): JSX.Element {
14 | const navigate = useNavigate();
15 | const medplum = useMedplum();
16 | const { questionnaireId } = useParams();
17 |
18 | const questionnaire = useResource({ reference: `Questionnaire/${questionnaireId}` });
19 |
20 | const handleOnSubmit = useCallback(
21 | (response: QuestionnaireResponse) => {
22 | if (!questionnaire) {
23 | return;
24 | }
25 |
26 | medplum
27 | .createResource(response)
28 | .then(() => {
29 | showNotification({
30 | icon: ,
31 | title: 'Success',
32 | message: 'Answers recorded',
33 | });
34 | navigate('/health-record/questionnaire-responses/')?.catch(console.error);
35 | window.scrollTo(0, 0);
36 | })
37 | .catch((err) => {
38 | showNotification({
39 | color: 'red',
40 | icon: ,
41 | title: 'Error',
42 | message: normalizeErrorString(err),
43 | });
44 | });
45 | },
46 | [medplum, navigate, questionnaire]
47 | );
48 |
49 | if (!questionnaire) {
50 | return ;
51 | }
52 |
53 | return (
54 |
55 |
56 |
57 | );
58 | }
59 |
--------------------------------------------------------------------------------
/src/pages/account/MembershipAndBilling.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Stack, Table, Title } from '@mantine/core';
4 | import { formatCoding, getReferenceString } from '@medplum/core';
5 | import type { Coverage, Patient } from '@medplum/fhirtypes';
6 | import { useMedplum } from '@medplum/react';
7 | import type { JSX } from 'react';
8 | import { InfoButton } from '../../components/InfoButton';
9 | import { InfoSection } from '../../components/InfoSection';
10 |
11 | function CoverageTable({ coverages }: { coverages: Coverage[] }): JSX.Element {
12 | return (
13 |
14 |
15 |
16 | Payor Name
17 | Subscriber ID
18 | Relationship to Subscriber
19 |
20 |
21 |
22 | {coverages.map((c) => (
23 |
24 | {c.payor?.[0].display}
25 | {c.subscriberId || '-'}
26 | {formatCoding(c.relationship?.coding?.[0]) || '-'}
27 |
28 | ))}
29 |
30 |
31 | );
32 | }
33 |
34 | export function MembershipAndBilling(): JSX.Element {
35 | const medplum = useMedplum();
36 | const patient = medplum.getProfile() as Patient;
37 | const coverages = medplum
38 | .searchResources('Coverage', {
39 | beneficiary: getReferenceString(patient),
40 | })
41 | .read();
42 | const payments = medplum.searchResources('PaymentNotice').read();
43 |
44 | return (
45 |
46 | Membership & Billing
47 |
48 | {coverages.length === 0 ? (
49 | No coverage
50 | ) : (
51 |
52 |
53 |
54 | )}
55 |
56 |
57 | {payments.length === 0 ? (
58 | No payments
59 | ) : (
60 |
61 | {payments.map((p) => (
62 | {p.id}
63 | ))}
64 |
65 | )}
66 |
67 |
68 | );
69 | }
70 |
--------------------------------------------------------------------------------
/src/img/homePage/better-sleep.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
14 |
18 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/pages/landing/index.module.css:
--------------------------------------------------------------------------------
1 | .outer {
2 | overflow: hidden;
3 | background-image: radial-gradient(640px at left top, var(--mantine-primary-color-light), white);
4 | }
5 |
6 | .inner {
7 | position: relative;
8 | display: flex;
9 | justify-content: space-between;
10 | padding-top: 6rem;
11 | padding-bottom: 6rem;
12 | margin-top: 6rem;
13 | margin-bottom: 6rem;
14 |
15 | @mixin smaller-than $mantine-breakpoint-md {
16 | flex-direction: column;
17 | }
18 | }
19 |
20 | .content {
21 | max-width: 480px;
22 | margin-right: 4.5rem;
23 | }
24 |
25 | .title {
26 | color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
27 | font-family:
28 | Greycliff CF,
29 | theme.fontFamily;
30 | font-size: 56px;
31 | line-height: 1.2;
32 | font-weight: 600;
33 |
34 | @mixin smaller-than $mantine-breakpoint-xs {
35 | font-size: 28px;
36 | }
37 | }
38 |
39 | .control {
40 | @mixin smaller-than $mantine-breakpoint-xs {
41 | flex: 1;
42 | }
43 | }
44 |
45 | .highlight {
46 | color: var(--mantine-primary-color-filled);
47 | }
48 |
49 | .heroImage1,
50 | .heroImage2,
51 | .heroImage3,
52 | .heroImage4 {
53 | position: absolute;
54 | border-radius: 50%;
55 | object-fit: cover;
56 | }
57 |
58 | .heroImage1 {
59 | top: 192px;
60 | right: 24px;
61 | width: 384px;
62 | height: 384px;
63 |
64 | @mixin smaller-than $mantine-breakpoint-md {
65 | display: none;
66 | }
67 | }
68 |
69 | .heroImage2 {
70 | top: 415px;
71 | left: 435px;
72 | width: 288px;
73 | height: 288px;
74 |
75 | @mixin smaller-than $mantine-breakpoint-md {
76 | position: static;
77 | }
78 | }
79 |
80 | .heroImage3 {
81 | top: 0;
82 | right: -128px;
83 | width: 448px;
84 | height: 448px;
85 | }
86 |
87 | .heroImage4 {
88 | top: -48px;
89 | left: -432px;
90 | width: 864px;
91 | height: 864px;
92 |
93 | @mixin smaller-than $mantine-breakpoint-md {
94 | position: static;
95 | width: 288px;
96 | height: 288px;
97 | }
98 | }
99 |
100 | .featureSection {
101 | justify-content: flex-end;
102 | padding-top: 0;
103 | }
104 |
105 | .featureBox {
106 | background: var(--mantine-primary-color-light);
107 | border-radius: var(--mantine-radius-xl);
108 | padding: 2.25rem;
109 | width: 512px;
110 | }
111 |
112 | .featureTitle {
113 | font-size: 24px;
114 | font-weight: 600;
115 | margin-bottom: var(--mantine-spacing-md);
116 | }
117 |
118 | .featureDescription {
119 | font-size: 18px;
120 | color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-0));
121 | }
122 |
--------------------------------------------------------------------------------
/src/img/pills.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
14 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/pages/health-record/Response.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Paper, Stack, Title } from '@mantine/core';
4 | import type { TitleOrder } from '@mantine/core';
5 | import { formatDate } from '@medplum/core';
6 | import type { QuestionnaireResponseItem, QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
7 | import { CodeableConceptDisplay, QuantityDisplay, RangeDisplay, useMedplum } from '@medplum/react';
8 | import type { JSX } from 'react';
9 | import { useParams } from 'react-router';
10 |
11 | export function Response(): JSX.Element {
12 | const medplum = useMedplum();
13 | const { responseId } = useParams();
14 | const questionnaireResponse = medplum.searchOne('QuestionnaireResponse', `_id=${responseId}`).read();
15 |
16 | const items = questionnaireResponse?.item || [];
17 |
18 | return (
19 |
20 |
21 |
22 | {items.map((item) => (
23 |
24 | ))}
25 |
26 |
27 |
28 | );
29 | }
30 |
31 | interface ItemDisplayProps {
32 | item: QuestionnaireResponseItem;
33 | order: TitleOrder;
34 | }
35 |
36 | function ItemDisplay({ item, order }: ItemDisplayProps): JSX.Element {
37 | const { text: title, answer, item: nestedAnswers } = item;
38 |
39 | return (
40 |
41 | {title}
42 |
43 | {answer && answer.length > 0 ? (
44 |
45 | ) : (
46 | nestedAnswers?.map((nestedAnswer) => (
47 |
48 | ))
49 | )}
50 |
51 |
52 | );
53 | }
54 |
55 | interface AnswerDisplayProps {
56 | answer: QuestionnaireResponseItemAnswer;
57 | }
58 |
59 | function AnswerDisplay({ answer }: AnswerDisplayProps): JSX.Element {
60 | if (!answer) {
61 | throw new Error('No answer');
62 | }
63 | const [[key, value]] = Object.entries(answer);
64 |
65 | switch (key) {
66 | case 'valueInteger':
67 | return {value}
;
68 | case 'valueQuantity':
69 | return ;
70 | case 'valueString':
71 | return {value}
;
72 | case 'valueCoding':
73 | return ;
74 | case 'valueRange':
75 | return ;
76 | case 'valueDateTime':
77 | return {formatDate(value)}
;
78 | case 'valueBoolean':
79 | return {value ? 'True' : 'False'}
;
80 | default:
81 | return {value.toString()}
;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/pages/health-record/Medication.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Anchor, Box, Button, Modal, Stack, Text, Title } from '@mantine/core';
4 | import { formatDateTime, formatHumanName, formatTiming } from '@medplum/core';
5 | import type { HumanName, MedicationRequest } from '@medplum/fhirtypes';
6 | import { ResourceTable, useMedplum } from '@medplum/react';
7 | import { useState } from 'react';
8 | import type { JSX } from 'react';
9 | import { useParams } from 'react-router';
10 | import { InfoSection } from '../../components/InfoSection';
11 |
12 | export function Medication(): JSX.Element {
13 | const medplum = useMedplum();
14 | const [modalOpen, setModalOpen] = useState(false);
15 | const { medicationId = '' } = useParams();
16 | const med: MedicationRequest = medplum.readResource('MedicationRequest', medicationId).read();
17 |
18 | return (
19 |
20 | {med.medicationCodeableConcept?.text}
21 | To refill this medication, please contact your pharmacy.
22 |
23 | No more refills available at your pharmacy?{' '}
24 | setModalOpen(true)}>Renew your prescription
25 |
26 |
27 |
28 |
29 |
30 |
31 | );
32 | }
33 |
34 | function RenewalModal({
35 | prev,
36 | opened,
37 | setOpened,
38 | }: {
39 | readonly prev: MedicationRequest;
40 | readonly opened: boolean;
41 | readonly setOpened: (o: boolean) => void;
42 | }): JSX.Element {
43 | const medplum = useMedplum();
44 | const patient = medplum.getProfile();
45 | return (
46 | setOpened(false)}
50 | title={Request a Renewal }
51 | >
52 |
53 |
54 |
55 |
56 |
57 |
61 | setOpened(false)}>Submit Renewal Request
62 |
63 |
64 | );
65 | }
66 |
67 | function KeyValue({ name, value }: { name: string; value: string | undefined }): JSX.Element {
68 | return (
69 |
70 |
71 | {name}
72 |
73 |
74 | {value}
75 |
76 |
77 | );
78 | }
79 |
--------------------------------------------------------------------------------
/src/pages/health-record/Measurement.data.ts:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | export interface ObservationType {
4 | id: string;
5 | code: string;
6 | title: string;
7 | description: string;
8 | chartDatasets: {
9 | label: string;
10 | code?: string;
11 | unit: string;
12 | backgroundColor: string;
13 | borderColor: string;
14 | }[];
15 | }
16 |
17 | const backgroundColor = 'rgba(29, 112, 214, 0.7)';
18 | const borderColor = 'rgba(29, 112, 214, 1)';
19 | const secondBackgroundColor = 'rgba(255, 119, 0, 0.7)';
20 | const secondBorderColor = 'rgba(255, 119, 0, 1)';
21 |
22 | export const measurementsMeta: Record = {
23 | 'blood-pressure': {
24 | id: 'blood-pressure',
25 | code: '85354-9',
26 | title: 'Blood Pressure',
27 | description:
28 | 'Your blood pressure is the pressure exerted on the walls of your blood vessels. When this pressure is high, it can damage your blood vessels and increase your risk for a heart attack or stroke. We measure your blood pressure periodically to make sure it is not staying high. Hypertention is a condition that refers to consistantly high blood pressure.',
29 | chartDatasets: [
30 | {
31 | label: 'Diastolic',
32 | code: '8462-4',
33 | unit: 'mm[Hg]',
34 | backgroundColor: secondBackgroundColor,
35 | borderColor: secondBorderColor,
36 | },
37 | {
38 | label: 'Systolic',
39 | code: '8480-6',
40 | unit: 'mm[Hg]',
41 | backgroundColor,
42 | borderColor,
43 | },
44 | ],
45 | },
46 | 'body-temperature': {
47 | id: 'body-temperature',
48 | code: '8310-5',
49 | title: 'Body Temperature',
50 | description: 'Your body temperature values',
51 | chartDatasets: [
52 | {
53 | label: 'Body Temperature',
54 | unit: 'C',
55 | backgroundColor,
56 | borderColor,
57 | },
58 | ],
59 | },
60 | height: {
61 | id: 'height',
62 | code: '8302-2',
63 | title: 'Height',
64 | description: 'Your height values',
65 | chartDatasets: [
66 | {
67 | label: 'Height',
68 | unit: 'in',
69 | backgroundColor,
70 | borderColor,
71 | },
72 | ],
73 | },
74 | 'respiratory-rate': {
75 | id: 'respiratory-rate',
76 | code: '9279-1',
77 | title: 'Respiratory Rate',
78 | description: 'Your respiratory rate values',
79 | chartDatasets: [
80 | {
81 | label: 'Respiratory Rate',
82 | unit: 'breaths/minute',
83 | backgroundColor,
84 | borderColor,
85 | },
86 | ],
87 | },
88 | 'heart-rate': {
89 | id: 'heart-rate',
90 | code: '8867-4',
91 | title: 'Heart Rate',
92 | description: 'Your heart rate values',
93 | chartDatasets: [
94 | {
95 | label: 'Heart Rate',
96 | unit: 'beats/minute',
97 | backgroundColor,
98 | borderColor,
99 | },
100 | ],
101 | },
102 | weight: {
103 | id: 'weight',
104 | code: '29463-7',
105 | title: 'Weight',
106 | description: 'Your weight values',
107 | chartDatasets: [
108 | {
109 | label: 'Weight',
110 | unit: 'lbs',
111 | backgroundColor,
112 | borderColor,
113 | },
114 | ],
115 | },
116 | };
117 |
--------------------------------------------------------------------------------
/src/pages/health-record/Vaccines.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Anchor, Box, Stack, Text, Title, useMantineTheme } from '@mantine/core';
4 | import { formatDate, getReferenceString } from '@medplum/core';
5 | import type { Immunization, Patient } from '@medplum/fhirtypes';
6 | import { StatusBadge, useMedplum } from '@medplum/react';
7 | import { IconCalendar, IconMapPin } from '@tabler/icons-react';
8 | import type { JSX } from 'react';
9 | import { useNavigate } from 'react-router';
10 | import { InfoButton } from '../../components/InfoButton';
11 | import { InfoSection } from '../../components/InfoSection';
12 | import PillsImage from '../../img/pills.svg';
13 |
14 | export function Vaccines(): JSX.Element {
15 | const medplum = useMedplum();
16 | const patient = medplum.getProfile() as Patient;
17 | const vaccines = medplum.searchResources('Immunization', 'patient=' + getReferenceString(patient)).read();
18 | const today = new Date().toISOString();
19 | const activeVaccines = vaccines.filter((v) => v.occurrenceDateTime && v.occurrenceDateTime > today);
20 | const pastVaccines = vaccines.filter((v) => !v.occurrenceDateTime || v.occurrenceDateTime <= today);
21 |
22 | return (
23 |
24 | Vaccines
25 |
26 | {activeVaccines.length === 0 ? (
27 |
28 |
29 |
30 |
31 | No upcoming vaccines available
32 |
33 |
34 | If you think you're missing upcoming vaccines that should be here, please{' '}
35 | contact our medical team .
36 |
37 |
38 |
39 | ) : (
40 |
41 | )}
42 |
43 | {pastVaccines.length > 0 && (
44 |
45 |
46 |
47 | )}
48 |
49 | );
50 | }
51 |
52 | function VaccineList({ vaccines }: { vaccines: Immunization[] }): JSX.Element {
53 | return (
54 |
55 | {vaccines.map((vaccine) => (
56 |
57 | ))}
58 |
59 | );
60 | }
61 |
62 | function Vaccine({ vaccine }: { vaccine: Immunization }): JSX.Element {
63 | const theme = useMantineTheme();
64 | const navigate = useNavigate();
65 | return (
66 | navigate(`./${vaccine.id}`)?.catch(console.error)}>
67 |
68 |
69 | {vaccine.vaccineCode?.text}
70 |
71 |
72 |
73 | {vaccine.location?.display}
74 |
75 |
76 |
77 |
78 | {vaccine.occurrenceDateTime && (
79 |
80 |
81 | {formatDate(vaccine.occurrenceDateTime as string)}
82 |
83 | )}
84 |
85 |
86 | );
87 | }
88 |
--------------------------------------------------------------------------------
/src/components/Header.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { AppShell, Burger, Container, Group, Menu, UnstyledButton, useMantineTheme } from '@mantine/core';
4 | import { useDisclosure } from '@mantine/hooks';
5 | import { ResourceAvatar, useMedplumProfile } from '@medplum/react';
6 | import { IconChevronDown, IconLogout, IconSettings, IconUserCircle } from '@tabler/icons-react';
7 | import cx from 'clsx';
8 | import { useState } from 'react';
9 | import type { JSX } from 'react';
10 | import { Link, useNavigate } from 'react-router';
11 | import classes from './Header.module.css';
12 | import { Logo } from './Logo';
13 |
14 | const navigation = [
15 | { name: 'Health Record', href: '/health-record' },
16 | { name: 'Messages', href: '/messages' },
17 | { name: 'Care Plan', href: '/care-plan' },
18 | { name: 'Get Care', href: '/get-care' },
19 | ];
20 |
21 | export function Header(): JSX.Element {
22 | const navigate = useNavigate();
23 | const profile = useMedplumProfile();
24 | const theme = useMantineTheme();
25 | const [opened, { toggle }] = useDisclosure(false);
26 | const [userMenuOpened, setUserMenuOpened] = useState(false);
27 |
28 | return (
29 |
30 |
31 |
32 | navigate('/')?.catch(console.error)}>
33 |
34 |
35 |
36 | {navigation.map((link) => (
37 |
38 | {link.name}
39 |
40 | ))}
41 |
42 |
setUserMenuOpened(false)}
48 | onOpen={() => setUserMenuOpened(true)}
49 | >
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | }
61 | onClick={() => navigate('/account/profile')?.catch(console.error)}
62 | >
63 | Your profile
64 |
65 | }
67 | onClick={() => navigate('/account/profile')?.catch(console.error)}
68 | >
69 | Settings
70 |
71 | }
73 | onClick={() => navigate('/signout')?.catch(console.error)}
74 | >
75 | Sign out
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | );
84 | }
85 |
--------------------------------------------------------------------------------
/src/img/avatar-placeholder.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/pages/MessagesPage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Alert } from '@mantine/core';
4 | import { showNotification } from '@mantine/notifications';
5 | import { createReference, formatGivenName, getReferenceString, normalizeErrorString } from '@medplum/core';
6 | import type { Communication, HumanName, Patient, Practitioner } from '@medplum/fhirtypes';
7 | import { BaseChat, Document, useMedplum, useMedplumProfile, useResource } from '@medplum/react';
8 | import { IconCircleOff } from '@tabler/icons-react';
9 | import { useCallback, useMemo, useState } from 'react';
10 | import type { JSX } from 'react';
11 | import { useParams } from 'react-router';
12 | import { Loading } from '../components/Loading';
13 |
14 | export function Messages(): JSX.Element {
15 | const medplum = useMedplum();
16 | const profile = useMedplumProfile() as Patient;
17 | const profileRef = useMemo(() => (profile ? createReference(profile) : undefined), [profile]);
18 | const [communications, setCommunications] = useState([]);
19 | const { practitionerId } = useParams();
20 | const practitioner = useResource({
21 | reference: `Practitioner/${practitionerId}`,
22 | });
23 |
24 | const sendMessage = useCallback(
25 | (content: string): void => {
26 | if (!practitioner) {
27 | return;
28 | }
29 |
30 | if (!profileRef) {
31 | return;
32 | }
33 |
34 | const practitionerRef = createReference(practitioner);
35 |
36 | medplum
37 | .createResource({
38 | resourceType: 'Communication',
39 | status: 'in-progress',
40 | sender: profileRef,
41 | subject: profileRef,
42 | recipient: [practitionerRef],
43 | sent: new Date().toISOString(),
44 | payload: [{ contentString: content }],
45 | })
46 | .catch((err) => {
47 | showNotification({
48 | color: 'red',
49 | icon: ,
50 | title: 'Error',
51 | message: normalizeErrorString(err),
52 | });
53 | });
54 | },
55 | [medplum, profileRef, practitioner]
56 | );
57 |
58 | const handleMessageReceived = useCallback(
59 | (message: Communication): void => {
60 | if (message.received) {
61 | return;
62 | }
63 |
64 | medplum
65 | .updateResource({
66 | ...message,
67 | status: 'completed',
68 | received: new Date().toISOString(),
69 | })
70 | .catch((err) => {
71 | showNotification({
72 | color: 'red',
73 | icon: ,
74 | title: 'Error',
75 | message: normalizeErrorString(err),
76 | });
77 | });
78 | },
79 | [medplum]
80 | );
81 |
82 | if (!profileRef) {
83 | return Error: Provider profile not found ;
84 | }
85 |
86 | if (!practitioner) {
87 | return ;
88 | }
89 |
90 | return (
91 |
92 |
101 |
102 | );
103 | }
104 |
--------------------------------------------------------------------------------
/src/Router.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import type { JSX } from 'react';
4 | import { Navigate, Route, Routes } from 'react-router';
5 | import { AccountPage } from './pages/account';
6 | import { MembershipAndBilling } from './pages/account/MembershipAndBilling';
7 | import { Profile } from './pages/account/Profile';
8 | import { Provider } from './pages/account/Provider';
9 | import { CarePlanPage } from './pages/care-plan';
10 | import { ActionItem } from './pages/care-plan/ActionItem';
11 | import { ActionItems } from './pages/care-plan/ActionItems';
12 | import { GetCare } from './pages/GetCarePage';
13 | import { HealthRecord } from './pages/health-record';
14 | import { LabResult } from './pages/health-record/LabResult';
15 | import { LabResults } from './pages/health-record/LabResults';
16 | import { Measurement } from './pages/health-record/Measurement';
17 | import { Medication } from './pages/health-record/Medication';
18 | import { Medications } from './pages/health-record/Medications';
19 | import { Response } from './pages/health-record/Response';
20 | import { Responses } from './pages/health-record/Responses';
21 | import { Vaccine } from './pages/health-record/Vaccine';
22 | import { Vaccines } from './pages/health-record/Vaccines';
23 | import { Vitals } from './pages/health-record/Vitals';
24 | import { HomePage } from './pages/HomePage';
25 | import { Messages } from './pages/MessagesPage';
26 | import { MessageTable } from './pages/MessageTablePage';
27 | import { ObservationPage } from './pages/ObservationPage';
28 | import { PatientIntakeQuestionnairePage } from './pages/PatientIntakeQuestionnairePage';
29 | import { QuestionnairePage } from './pages/QuestionnairePage';
30 | import { ScreeningQuestionnairePage } from './pages/ScreeningQuestionnairePage';
31 | import { SignOutPage } from './pages/SignOutPage';
32 |
33 | export function Router(): JSX.Element {
34 | return (
35 |
36 | } />
37 | } />
38 | } />
39 | } />
40 | } />
41 | } />
42 | }>
43 | } />
44 | } />
45 | } />
46 | } />
47 | } />
48 | } />
49 | } />
50 | } />
51 | } />
52 | } />
53 | } />
54 |
55 | } />
56 | }>
57 | } />
58 | } />
59 | } />
60 |
61 | } />
62 | }>
63 | } />
64 | } />
65 | } />
66 | } />
67 |
68 | } />
69 |
70 | );
71 | }
72 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Foo Medical
2 | A free and open-source healthcare webapp from the Medplum team.
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 
16 |
17 | ### What is Foo Medical?
18 |
19 | [Foo Medical](https://foomedical.com/) is a **ready to use medical practice sample app** that's open source. It's meant for developers to clone, customize and run.
20 |
21 | ### Features
22 |
23 | - Completely free and open-source
24 | - Secure and compliant [Medplum](https://www.medplum.com) backend, which is also open source
25 | - Patient registration and authentication
26 | - Health records
27 | - Lab results
28 | - Medications
29 | - Vaccines
30 | - Vitals
31 | - Patient-provider messaging
32 | - Care plans
33 | - Patient scheduling
34 | - All data represented in [FHIR](https://hl7.org/FHIR/)
35 |
36 | Foo Medical is designed to be forked and customized for your business' needs. Register on [foomedical.com](https://foomedical.com/) to see it in action.
37 |
38 | ### Getting Started
39 |
40 | First, [fork](https://github.com/medplum/foomedical/fork) and clone the repo.
41 |
42 | Next, install the app from your terminal
43 |
44 | ```bash
45 | npm install
46 | ```
47 |
48 | Then, run the app!
49 |
50 | ```bash
51 | npm run dev
52 | ```
53 |
54 | This app should run on `http://localhost:3000/`
55 |
56 | Log into the app on localhost using the same credentials you created on [foomedical.com](https://foomedical.com/) and you are ready to start customizing.
57 |
58 | ### Deploying your app
59 |
60 | To get started deploying your app we recommend making an account on [Vercel](https://vercel.com/), free accounts are available.
61 |
62 | You can deploy this application by [clicking here](https://vercel.com/new/clone?s=https%3A%2F%2Fgithub.com%2Fmedplum%2Ffoomedical&showOptionalTeamCreation=false).
63 |
64 | ### Account Setup
65 |
66 | By default, your locally running Foo Medical app is pointing to the hosted Medplum service. Foo Medical registers signups to a test project.
67 |
68 | To send patients to your own organization you will need to [register a new Project on Medplum](https://www.medplum.com/docs/tutorials/register) and configure your environment variables to point to your own project (see [config.ts](https://github.com/medplum/foomedical/blob/main/src/config.ts) for an example).
69 |
70 | If you are using the Medplum Hosted service, you can login to your Medplum Instance and add the following identifiers to your [Project Site Settings](https://app.medplum.com/admin/sites)
71 |
72 | - Google Client Id
73 | - Google Client Secret
74 | - Recaptcha Site Key
75 | - Recaptcha Secret Key
76 |
77 | Contact the medplum team ([support@medplum.com](mailto:support@medplum.com) or [Discord](https://discord.gg/medplum])) with any questions.
78 |
79 | ### Data Setup
80 |
81 | When you log into Foo Medical a set of sample FHIR records is created on your behalf. The ability to run automations is part of the Medplum platform using a framework called [Bots](https://www.medplum.com/docs/bots). For reference, Bot that created the records in Foo Medical can be found [here](https://github.com/medplum/medplum-demo-bots/blob/main/src/sample-account-setup.ts).
82 |
83 | ### Compliance
84 |
85 | Medplum backend is HIPAA compliant and SOC 2 certified. Getting an account set up requires registering on [medplum.com](https://www.medplum.com/). Feel free to ask us questions in real time on our [Discord Server](https://discord.gg/medplum).
86 |
87 | ### About Medplum
88 |
89 | [Medplum](https://www.medplum.com/) is an open-source, API-first EHR. Medplum makes it easy to build healthcare apps quickly with less code.
90 |
91 | Medplum supports self-hosting and provides a [hosted service](https://app.medplum.com/). [Foo Medical](https://foomedical.com/) uses the hosted service as a backend.
92 |
93 | - Read our [documentation](https://www.medplum.com/docs/)
94 | - Browse our [React component library](https://storybook.medplum.com/)
95 | - Join our [Discord](https://discord.gg/medplum)
96 |
--------------------------------------------------------------------------------
/src/pages/landing/index.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { AppShell, Box, Button, Container, Group, Stack, Text, Title, useMantineTheme } from '@mantine/core';
4 | import cx from 'clsx';
5 | import type { JSX } from 'react';
6 | import { Footer } from '../../components/Footer';
7 | import DoctorImage from '../../img/landingPage/doctor.jpg';
8 | import EngineeringImage from '../../img/landingPage/engineering.jpg';
9 | import LabImage from '../../img/landingPage/laboratory.jpg';
10 | import WorkingEnvironmentImage from '../../img/landingPage/working-environment.jpg';
11 | import { Header } from './Header';
12 | import classes from './index.module.css';
13 |
14 | const features = [
15 | {
16 | title: 'Comprehsive Care Plans',
17 | description:
18 | 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.',
19 | },
20 | {
21 | title: 'No hidden fees',
22 | description:
23 | 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.',
24 | },
25 | {
26 | title: '24/7 Messaging',
27 | description:
28 | 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.',
29 | },
30 | {
31 | title: 'Clinically rigorous',
32 | description:
33 | 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.',
34 | },
35 | ];
36 |
37 | export function LandingPage(): JSX.Element {
38 | const theme = useMantineTheme();
39 | return (
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | An extraordinary
49 |
50 | doctor's office
51 |
52 |
53 | This is not actually a medical practice, this is a sample open source application for developers to
54 | clone, customize and run.
55 |
56 |
57 |
58 | Get started
59 |
60 |
61 | Source code
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Healthcare
73 |
74 |
75 | A better way to get care
76 |
77 |
78 | Lorem ipsum dolor sit amet consect adipisicing elit. Possimus magnam voluptatum cupiditate veritatis in
79 | accusamus quisquam.
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | {features.map((feature, index) => (
89 |
90 | {feature.title}
91 | {feature.description}
92 |
93 | ))}
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | );
102 | }
103 |
--------------------------------------------------------------------------------
/src/pages/account/Profile.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Box, Button, InputLabel, LoadingOverlay, NativeSelect, Stack, TextInput, Title } from '@mantine/core';
4 | import { showNotification } from '@mantine/notifications';
5 | import { formatFamilyName, formatGivenName, formatHumanName, normalizeErrorString } from '@medplum/core';
6 | import type { Address, HumanName, Patient } from '@medplum/fhirtypes';
7 | import { AddressInput, Form, ResourceAvatar, useMedplum } from '@medplum/react';
8 | import { IconCircleCheck, IconCircleOff } from '@tabler/icons-react';
9 | import { useState } from 'react';
10 | import type { JSX } from 'react';
11 | import { InfoSection } from '../../components/InfoSection';
12 |
13 | export function Profile(): JSX.Element | null {
14 | const medplum = useMedplum();
15 | const [profile, setProfile] = useState(medplum.getProfile() as Patient);
16 | const [loading, setLoading] = useState(false);
17 | const [address, setAddress] = useState(profile.address?.[0] || {});
18 |
19 | async function handleProfileEdit(formData: Record): Promise {
20 | setLoading(true);
21 | const newProfile: Patient = {
22 | ...profile,
23 | name: [
24 | {
25 | use: 'official',
26 | given: [formData.givenName],
27 | family: formData.familyName,
28 | },
29 | ],
30 | birthDate: formData.birthDate,
31 | gender: formData.gender as Patient['gender'],
32 | address: [address],
33 | };
34 | const updatedProfile = await medplum
35 | .updateResource(newProfile)
36 | .then((profile) => {
37 | showNotification({
38 | icon: ,
39 | title: 'Success',
40 | message: 'Profile edited',
41 | });
42 | window.scrollTo(0, 0);
43 | return profile;
44 | })
45 | .catch((err) => {
46 | showNotification({
47 | color: 'red',
48 | icon: ,
49 | title: 'Error',
50 | message: normalizeErrorString(err),
51 | });
52 | });
53 | if (updatedProfile) {
54 | setProfile(updatedProfile as Patient);
55 | }
56 | setLoading(false);
57 | }
58 |
59 | return (
60 |
61 |
62 |
118 |
119 | );
120 | }
121 |
--------------------------------------------------------------------------------
/src/pages/health-record/Measurement.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { Alert, Box, Button, Group, Modal, NumberInput, Stack, Table, Title } from '@mantine/core';
4 | import { createReference, formatDate, formatDateTime, formatObservationValue, getReferenceString } from '@medplum/core';
5 | import type { Observation, ObservationComponent, Patient } from '@medplum/fhirtypes';
6 | import { Document, Form, useMedplum } from '@medplum/react';
7 | import { IconAlertCircle } from '@tabler/icons-react';
8 | import type { ChartData, ChartDataset } from 'chart.js';
9 | import { useEffect, useState } from 'react';
10 | import type { JSX } from 'react';
11 | import { useParams } from 'react-router';
12 | import { LineChart } from '../../components/LineChart';
13 | import { measurementsMeta } from './Measurement.data';
14 |
15 | export function Measurement(): JSX.Element | null {
16 | const { measurementId } = useParams();
17 | const { code, title, description, chartDatasets } = measurementsMeta[measurementId as string];
18 | const medplum = useMedplum();
19 | const patient = medplum.getProfile() as Patient;
20 | const [modalOpen, setModalOpen] = useState(false);
21 | const [chartData, setChartData] = useState>();
22 |
23 | const observations = medplum
24 | .searchResources('Observation', `code=${code}&patient=${getReferenceString(patient)}`)
25 | .read();
26 |
27 | useEffect(() => {
28 | if (observations) {
29 | const labels: string[] = [];
30 | const datasets: ChartDataset<'line', number[]>[] = chartDatasets.map((item) => ({ ...item, data: [] }));
31 | for (const obs of observations) {
32 | labels.push(formatDate(obs.effectiveDateTime));
33 | if (chartDatasets.length === 1) {
34 | datasets[0].data.push(obs.valueQuantity?.value as number);
35 | } else {
36 | for (let i = 0; i < chartDatasets.length; i++) {
37 | datasets[i].data.push((obs.component as ObservationComponent[])[i].valueQuantity?.value as number);
38 | }
39 | }
40 | }
41 | setChartData({ labels, datasets });
42 | }
43 | }, [chartDatasets, observations]);
44 |
45 | function addObservation(formData: Record): void {
46 | console.log(formData);
47 |
48 | const obs: Observation = {
49 | resourceType: 'Observation',
50 | status: 'preliminary',
51 | subject: createReference(patient),
52 | effectiveDateTime: new Date().toISOString(),
53 | code: {
54 | coding: [
55 | {
56 | code,
57 | display: title,
58 | system: 'http://loinc.org',
59 | },
60 | ],
61 | text: title,
62 | },
63 | };
64 |
65 | if (chartDatasets.length === 1) {
66 | obs.valueQuantity = {
67 | value: Number.parseFloat(formData[chartDatasets[0].label]),
68 | system: 'http://unitsofmeasure.org',
69 | unit: chartDatasets[0].unit,
70 | code: chartDatasets[0].unit,
71 | };
72 | } else {
73 | obs.component = chartDatasets.map((item) => ({
74 | code: {
75 | coding: [
76 | {
77 | code: '8462-4',
78 | display: 'Diastolic Blood Pressure',
79 | system: 'http://loinc.org',
80 | },
81 | ],
82 | text: item.label,
83 | },
84 | valueQuantity: {
85 | value: Number.parseFloat(formData[item.label]),
86 | system: 'http://unitsofmeasure.org',
87 | unit: item.unit,
88 | code: item.unit,
89 | },
90 | }));
91 | }
92 |
93 | medplum
94 | .createResource(obs)
95 | .then(() => setModalOpen(false))
96 | .catch(console.error);
97 | }
98 |
99 | return (
100 |
101 |
102 | {title}
103 | setModalOpen(true)}>Add Measurement
104 |
105 | {chartData && }
106 |
107 | } title="What is this measurement?" color="gray" radius="md">
108 | {description}
109 |
110 |
111 | {observations?.length && (
112 |
113 |
114 |
115 | Date
116 | Your Value
117 |
118 |
119 |
120 | {observations.map((obs) => (
121 |
122 | {formatDateTime(obs.effectiveDateTime as string)}
123 | {formatObservationValue(obs)}
124 |
125 | ))}
126 |
127 |
128 | )}
129 | setModalOpen(false)} title={title}>
130 |
142 |
143 |
144 | );
145 | }
146 |
--------------------------------------------------------------------------------
/src/pages/landing/Header.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import {
4 | Anchor,
5 | AppShell,
6 | Box,
7 | Burger,
8 | Button,
9 | Center,
10 | Collapse,
11 | Container,
12 | Divider,
13 | Drawer,
14 | Group,
15 | HoverCard,
16 | rem,
17 | ScrollArea,
18 | SimpleGrid,
19 | Text,
20 | ThemeIcon,
21 | UnstyledButton,
22 | useMantineTheme,
23 | } from '@mantine/core';
24 | import { useDisclosure } from '@mantine/hooks';
25 | import {
26 | IconBook,
27 | IconChartPie3,
28 | IconChevronDown,
29 | IconCode,
30 | IconCoin,
31 | IconFingerprint,
32 | IconNotification,
33 | } from '@tabler/icons-react';
34 | import type { JSX } from 'react';
35 | import { useNavigate } from 'react-router';
36 | import { Logo } from '../../components/Logo';
37 | import classes from './Header.module.css';
38 |
39 | const mockdata = [
40 | {
41 | icon: IconCode,
42 | title: 'Open source',
43 | description: 'This Pokémon’s cry is very loud and distracting',
44 | },
45 | {
46 | icon: IconCoin,
47 | title: 'Free for everyone',
48 | description: 'The fluid of Smeargle’s tail secretions changes',
49 | },
50 | {
51 | icon: IconBook,
52 | title: 'Documentation',
53 | description: 'Yanma is capable of seeing 360 degrees without',
54 | },
55 | {
56 | icon: IconFingerprint,
57 | title: 'Security',
58 | description: 'The shell’s rounded shape and the grooves on its.',
59 | },
60 | {
61 | icon: IconChartPie3,
62 | title: 'Analytics',
63 | description: 'This Pokémon uses its flying ability to quickly chase',
64 | },
65 | {
66 | icon: IconNotification,
67 | title: 'Notifications',
68 | description: 'Combusken battles with the intensely hot flames it spews',
69 | },
70 | ];
71 |
72 | export function Header(): JSX.Element {
73 | const navigate = useNavigate();
74 | const [drawerOpened, { toggle: toggleDrawer, close: closeDrawer }] = useDisclosure(false);
75 | const [linksOpened, { toggle: toggleLinks }] = useDisclosure(false);
76 | const theme = useMantineTheme();
77 |
78 | const links = mockdata.map((item) => (
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | {item.title}
87 |
88 |
89 | {item.description}
90 |
91 |
92 |
93 |
94 | ));
95 |
96 | return (
97 | <>
98 |
99 |
100 |
101 | navigate('/')?.catch(console.error)}>
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | Services
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | Services
121 |
122 | View all
123 |
124 |
125 |
126 |
127 |
128 |
129 | {links}
130 |
131 |
132 |
133 |
134 |
135 |
136 | Get started
137 |
138 |
139 | Their food sources have decreased, and their numbers
140 |
141 |
142 | Get started
143 |
144 |
145 |
146 |
147 |
148 | Counseling
149 |
150 |
151 | Physicians
152 |
153 |
154 | More
155 |
156 |
157 |
158 |
159 | navigate('/signin')?.catch(console.error)}>
160 | Log in
161 |
162 | navigate('/register')?.catch(console.error)}>Sign up
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
179 |
180 |
181 |
182 |
183 | Home
184 |
185 |
186 |
187 |
188 | Features
189 |
190 |
191 |
192 |
193 | {links}
194 |
195 | Learn
196 |
197 |
198 | Academy
199 |
200 |
201 |
202 |
203 |
204 | navigate('/signin')?.catch(console.error)}>
205 | Log in
206 |
207 | navigate('/register')?.catch(console.error)}>Sign up
208 |
209 |
210 |
211 | >
212 | );
213 | }
214 |
--------------------------------------------------------------------------------
/src/img/homePage/doctor.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
10 |
16 |
19 |
22 |
25 |
27 |
29 |
31 |
32 |
40 |
44 |
45 |
48 |
51 |
52 |
54 |
55 |
57 |
59 |
60 |
62 |
63 |
65 |
67 |
68 |
71 |
74 |
75 |
76 |
77 |
80 |
81 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/src/pages/HomePage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import {
4 | Anchor,
5 | Avatar,
6 | Badge,
7 | Box,
8 | Button,
9 | Card,
10 | Container,
11 | Flex,
12 | Grid,
13 | Group,
14 | Image,
15 | Overlay,
16 | Stack,
17 | Text,
18 | Title,
19 | useMantineTheme,
20 | } from '@mantine/core';
21 | import { formatHumanName } from '@medplum/core';
22 | import type { Patient, Practitioner } from '@medplum/fhirtypes';
23 | import { useMedplumProfile } from '@medplum/react';
24 | import { IconChecklist, IconGift, IconSquareCheck } from '@tabler/icons-react';
25 | import type { JSX } from 'react';
26 | import { useNavigate } from 'react-router';
27 | import DoctorImage from '../img/homePage/doctor.svg';
28 | import HealthRecordImage from '../img/homePage/health-record.svg';
29 | import HealthVisitImage from '../img/homePage/health-visit.jpg';
30 | import PharmacyImage from '../img/homePage/pharmacy.svg';
31 | import PillImage from '../img/homePage/pill.svg';
32 | import classes from './HomePage.module.css';
33 |
34 | const carouselItems = [
35 | {
36 | img: ,
37 | title: 'Welcome to Foo Medical',
38 | description:
39 | 'Lorem ipsum at porta donec ultricies ut, arcu morbi amet arcu ornare, curabitur pharetra magna tempus',
40 | url: '/screening-questionnaire',
41 | label: 'AHC HRSN Screening',
42 | },
43 | {
44 | img: ,
45 | title: 'Patient Intake Questionnaire',
46 | description:
47 | 'Lorem ipsum at porta donec ultricies ut, arcu morbi amet arcu ornare, curabitur pharetra magna tempus',
48 | url: '/patient-intake-questionnaire',
49 | label: 'Start Form',
50 | },
51 | {
52 | img: ,
53 | title: 'Select a Doctor',
54 | description:
55 | 'Lorem ipsum at porta donec ultricies ut, arcu morbi amet arcu ornare, curabitur pharetra magna tempus',
56 | url: '/account/provider/choose-a-primary-care-povider',
57 | label: 'Choose a Primary Care Provider',
58 | },
59 | {
60 | img: ,
61 | title: 'Emergency Contact',
62 | description:
63 | 'Lorem ipsum at porta donec ultricies ut, arcu morbi amet arcu ornare, curabitur pharetra magna tempus',
64 | url: '/account',
65 | label: 'Add emergency contact',
66 | },
67 | ];
68 |
69 | const linkPages = [
70 | {
71 | img: HealthRecordImage,
72 | title: 'Health Record',
73 | description: '',
74 | href: '/health-record',
75 | },
76 | {
77 | img: PillImage,
78 | title: 'Request Prescription Renewal',
79 | description: '',
80 | href: '/health-record/medications',
81 | },
82 | {
83 | img: PharmacyImage,
84 | title: 'Preferred Pharmacy',
85 | description: 'Walgreens D2866 1363 Divisadero St DIVISADERO',
86 | href: '#',
87 | },
88 | ];
89 |
90 | const recommendations = [
91 | {
92 | title: 'Get travel health recommendations',
93 | description: 'Find out what vaccines and meds you need for your trip.',
94 | },
95 | {
96 | title: 'Get FSA/HSA reimbursement',
97 | description: 'Request a prescription for over-the-counter items.',
98 | },
99 | {
100 | title: 'Request health record',
101 | description: 'Get records sent to or from Foo Medical.',
102 | },
103 | ];
104 |
105 | export function HomePage(): JSX.Element {
106 | const navigate = useNavigate();
107 | const theme = useMantineTheme();
108 | const profile = useMedplumProfile() as Patient | Practitioner;
109 | const profileName = profile.name ? formatHumanName(profile.name[0]) : '';
110 |
111 | return (
112 |
113 |
114 |
115 | Announcements go here. Include links if needed.
116 |
117 |
118 |
119 |
124 |
125 |
126 | Hi {profileName} , we’re here to help
127 |
128 |
129 | Get Care
130 |
131 |
132 |
133 |
134 |
135 |
136 | Put calls to action here
137 | navigate('/messages')?.catch(console.error)}>
138 | Send Message
139 |
140 |
141 |
142 |
143 |
144 |
145 | {carouselItems.map((item, index) => (
146 |
147 |
148 |
149 |
150 | {item.title}
151 |
152 |
153 | {item.description}
154 |
155 | {item.label}
156 |
157 |
158 | ))}
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 | Better rest, better health
168 |
169 |
170 | Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste
171 | dolor cupiditate blanditiis ratione. Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores
172 | impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.
173 |
174 |
175 | Invite Friends
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 | Now available
188 |
189 |
190 | Title
191 |
192 |
193 | Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque,
194 | iste dolor cupiditate blanditiis ratione. Lorem ipsum, dolor sit amet consectetur adipisicing elit.
195 | Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 | {linkPages.map((item, index) => (
206 |
207 |
208 |
209 |
210 | {item.title}
211 |
212 |
213 |
214 | ))}
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 | Primary Care Provider
227 |
228 | Having a consistent, trusted provider can lead to better health.
229 |
230 | navigate('/account/provider')?.catch(console.error)}>Choose Provider
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 | {recommendations.map((item, index) => (
239 |
240 | {item.title}
241 |
242 | {item.description}
243 |
244 |
245 | ))}
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 | );
254 | }
255 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
--------------------------------------------------------------------------------
/src/img/homePage/pharmacy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
37 |
39 |
40 |
41 |
45 |
49 |
55 |
58 |
63 |
69 |
73 |
75 |
76 |
77 |
81 |
85 |
91 |
94 |
99 |
105 |
109 |
111 |
112 |
113 |
114 |
116 |
117 |
119 |
120 |
123 |
125 |
128 |
129 |
130 |
131 |
133 |
134 |
135 |
136 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
--------------------------------------------------------------------------------
/src/components/Logo.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import { useMantineTheme } from '@mantine/core';
4 | import type { JSX } from 'react';
5 |
6 | export interface LogoProps {
7 | readonly width: number;
8 | }
9 |
10 | export function Logo(props: LogoProps): JSX.Element {
11 | const theme = useMantineTheme();
12 | const color = theme.primaryColor;
13 | const width = props.width;
14 | const height = Math.round((180 / 1050) * width);
15 | return (
16 |
24 |
28 |
32 |
36 |
40 |
44 |
48 |
52 |
56 |
60 |
61 |
62 |
63 |
64 |
65 |
69 |
70 | );
71 | }
72 |
--------------------------------------------------------------------------------
/src/pages/PatientIntakeQuestionnairePage.tsx:
--------------------------------------------------------------------------------
1 | // SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 | import type { Questionnaire, QuestionnaireResponse } from '@medplum/fhirtypes';
4 | import { Document, QuestionnaireForm } from '@medplum/react';
5 | import { useState } from 'react';
6 | import type { JSX } from 'react';
7 |
8 | export function PatientIntakeQuestionnairePage(): JSX.Element {
9 | const [isSubmitted, setIsSubmitted] = useState(false);
10 |
11 | async function handleQuestionnaireSubmit(_formData: QuestionnaireResponse): Promise {
12 | setIsSubmitted(true);
13 | window.scrollTo(0, 0);
14 | }
15 |
16 | return (
17 |
18 | {isSubmitted ? (
19 | Thank you for submitting your form
20 | ) : (
21 |
22 | )}
23 |
24 | );
25 | }
26 |
27 | const questionnaire: Questionnaire = {
28 | resourceType: 'Questionnaire',
29 | status: 'active',
30 | title: 'Patient Intake Questionnaire',
31 | name: 'patient-intake',
32 | item: [
33 | {
34 | linkId: 'patient-demographics',
35 | text: 'Demographics',
36 | type: 'group',
37 | item: [
38 | {
39 | linkId: 'first-name',
40 | text: 'First Name',
41 | type: 'string',
42 | required: true,
43 | },
44 | {
45 | linkId: 'middle-name',
46 | text: 'Middle Name',
47 | type: 'string',
48 | },
49 | {
50 | linkId: 'last-name',
51 | text: 'Last Name',
52 | type: 'string',
53 | required: true,
54 | },
55 | {
56 | linkId: 'dob',
57 | text: 'Date of Birth',
58 | type: 'date',
59 | },
60 | {
61 | linkId: 'street',
62 | text: 'Street',
63 | type: 'string',
64 | },
65 | {
66 | linkId: 'city',
67 | text: 'City',
68 | type: 'string',
69 | },
70 | {
71 | linkId: 'state',
72 | text: 'State',
73 | type: 'choice',
74 | answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state',
75 | },
76 | {
77 | linkId: 'zip',
78 | text: 'Zip',
79 | type: 'string',
80 | },
81 | {
82 | linkId: 'phone',
83 | text: 'Phone',
84 | type: 'string',
85 | },
86 | {
87 | linkId: 'ssn',
88 | text: 'Social Security Number',
89 | type: 'string',
90 | required: true,
91 | },
92 | {
93 | linkId: 'race',
94 | text: 'Race',
95 | type: 'choice',
96 | answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/omb-race-category',
97 | },
98 | {
99 | linkId: 'ethnicity',
100 | text: 'Ethnicity',
101 | type: 'choice',
102 | answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category',
103 | },
104 | {
105 | linkId: 'gender-identity',
106 | text: 'Gender Identity',
107 | type: 'choice',
108 | answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.32',
109 | },
110 | {
111 | linkId: 'sexual-orientation',
112 | text: 'Sexual Orientation',
113 | type: 'choice',
114 | answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-sexual-orientation',
115 | },
116 | ],
117 | },
118 | {
119 | linkId: 'emergency-contact',
120 | text: 'Emergency Contact',
121 | type: 'group',
122 | repeats: true,
123 | item: [
124 | {
125 | linkId: 'emergency-contact-first-name',
126 | text: 'First Name',
127 | type: 'string',
128 | },
129 | {
130 | linkId: 'emergency-contact-middle-name',
131 | text: 'Middle Name',
132 | type: 'string',
133 | },
134 | {
135 | linkId: 'emergency-contact-last-name',
136 | text: 'Last Name',
137 | type: 'string',
138 | },
139 | {
140 | linkId: 'emergency-contact-phone',
141 | text: 'Phone',
142 | type: 'string',
143 | },
144 | ],
145 | },
146 | {
147 | linkId: 'allergies',
148 | text: 'Allergies',
149 | type: 'group',
150 | repeats: true,
151 | item: [
152 | {
153 | linkId: 'allergy-substance',
154 | text: 'Substance',
155 | type: 'choice',
156 | answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.8',
157 | },
158 | {
159 | linkId: 'allergy-reaction',
160 | text: 'Reaction',
161 | type: 'string',
162 | },
163 | {
164 | linkId: 'allergy-onset',
165 | text: 'Onset',
166 | type: 'dateTime',
167 | },
168 | ],
169 | },
170 | {
171 | linkId: 'medications',
172 | text: 'Current medications',
173 | type: 'group',
174 | repeats: true,
175 | item: [
176 | {
177 | linkId: 'medication-code',
178 | text: 'Medication Name',
179 | type: 'choice',
180 | answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.4',
181 | },
182 | {
183 | linkId: 'medication-note',
184 | text: 'Note',
185 | type: 'string',
186 | },
187 | ],
188 | },
189 | {
190 | linkId: 'medical-history',
191 | text: 'Medical History',
192 | type: 'group',
193 | repeats: true,
194 | item: [
195 | {
196 | linkId: 'medical-history-problem',
197 | text: 'Problem',
198 | type: 'choice',
199 | answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code',
200 | },
201 | {
202 | linkId: 'medical-history-clinical-status',
203 | text: 'Status',
204 | type: 'choice',
205 | answerValueSet: 'http://hl7.org/fhir/ValueSet/condition-clinical',
206 | },
207 | {
208 | linkId: 'medical-history-onset',
209 | text: 'Onset',
210 | type: 'dateTime',
211 | },
212 | ],
213 | },
214 | {
215 | linkId: 'family-member-history',
216 | text: 'Family Member History',
217 | type: 'group',
218 | repeats: true,
219 | item: [
220 | {
221 | linkId: 'family-member-history-problem',
222 | text: 'Problem',
223 | type: 'choice',
224 | answerValueSet: 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code',
225 | },
226 | {
227 | linkId: 'family-member-history-relationship',
228 | text: 'Relationship',
229 | type: 'choice',
230 | answerValueSet: 'http://terminology.hl7.org/ValueSet/v3-FamilyMember',
231 | },
232 | {
233 | linkId: 'family-member-history-deceased',
234 | text: 'Deceased',
235 | type: 'boolean',
236 | },
237 | ],
238 | },
239 | {
240 | linkId: 'vaccination-history',
241 | text: 'Vaccination History',
242 | type: 'group',
243 | repeats: true,
244 | item: [
245 | {
246 | linkId: 'immunization-vaccine',
247 | text: 'Vaccine',
248 | type: 'choice',
249 | answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.6',
250 | },
251 | {
252 | linkId: 'immunization-date',
253 | text: 'Administration Date',
254 | type: 'dateTime',
255 | },
256 | ],
257 | },
258 | {
259 | linkId: 'preferred-pharmacy',
260 | text: 'Preferred Pharmacy',
261 | type: 'group',
262 | item: [
263 | {
264 | linkId: 'preferred-pharmacy-reference',
265 | text: 'Pharmacy',
266 | type: 'reference',
267 | extension: [
268 | {
269 | id: 'reference-pharmacy',
270 | url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource',
271 | valueCodeableConcept: {
272 | coding: [
273 | {
274 | system: 'http://hl7.org/fhir/fhir-types',
275 | display: 'Organizations',
276 | code: 'Organization',
277 | },
278 | ],
279 | },
280 | },
281 | ],
282 | },
283 | ],
284 | },
285 | {
286 | linkId: 'coverage-information',
287 | text: 'Coverage Information',
288 | type: 'group',
289 | repeats: true,
290 | item: [
291 | {
292 | linkId: 'insurance-provider',
293 | text: 'Insurance Provider',
294 | type: 'reference',
295 | required: true,
296 | extension: [
297 | {
298 | id: 'reference-insurance',
299 | url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource',
300 | valueCodeableConcept: {
301 | coding: [
302 | {
303 | system: 'http://hl7.org/fhir/fhir-types',
304 | display: 'Organizations',
305 | code: 'Organization',
306 | },
307 | ],
308 | },
309 | },
310 | ],
311 | },
312 | {
313 | linkId: 'subscriber-id',
314 | text: 'Subscriber ID',
315 | type: 'string',
316 | required: true,
317 | },
318 | {
319 | linkId: 'relationship-to-subscriber',
320 | text: 'Relationship to Subscriber',
321 | type: 'choice',
322 | answerValueSet: 'http://hl7.org/fhir/ValueSet/subscriber-relationship',
323 | required: true,
324 | },
325 | {
326 | linkId: 'related-person',
327 | text: 'Subscriber Information',
328 | type: 'group',
329 | enableBehavior: 'all',
330 | enableWhen: [
331 | {
332 | question: 'relationship-to-subscriber',
333 | operator: '!=',
334 | answerCoding: {
335 | system: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship',
336 | code: 'other',
337 | display: 'Other',
338 | },
339 | },
340 | {
341 | question: 'relationship-to-subscriber',
342 | operator: '!=',
343 | answerCoding: {
344 | system: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship',
345 | code: 'self',
346 | display: 'Self',
347 | },
348 | },
349 | {
350 | question: 'relationship-to-subscriber',
351 | operator: '!=',
352 | answerCoding: {
353 | system: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship',
354 | code: 'injured',
355 | display: 'Injured Party',
356 | },
357 | },
358 | ],
359 | item: [
360 | {
361 | linkId: 'related-person-first-name',
362 | text: 'First Name',
363 | type: 'string',
364 | },
365 | {
366 | linkId: 'related-person-middle-name',
367 | text: 'Middle Name',
368 | type: 'string',
369 | },
370 | {
371 | linkId: 'related-person-last-name',
372 | text: 'Last Name',
373 | type: 'string',
374 | },
375 | {
376 | linkId: 'related-person-dob',
377 | text: 'Date of Birth',
378 | type: 'date',
379 | },
380 | {
381 | linkId: 'related-person-gender-identity',
382 | text: 'Gender Identity',
383 | type: 'choice',
384 | answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.32',
385 | },
386 | ],
387 | },
388 | ],
389 | },
390 | {
391 | linkId: 'social-determinants-of-health',
392 | text: 'Social Determinants of Health',
393 | type: 'group',
394 | item: [
395 | {
396 | linkId: 'housing-status',
397 | text: 'Housing Status',
398 | type: 'choice',
399 | answerValueSet: 'http://terminology.hl7.org/ValueSet/v3-LivingArrangement',
400 | },
401 | {
402 | linkId: 'education-level',
403 | text: 'Education Level',
404 | type: 'choice',
405 | answerValueSet: 'http://terminology.hl7.org/ValueSet/v3-EducationLevel',
406 | },
407 | {
408 | linkId: 'smoking-status',
409 | text: 'Smoking Status',
410 | type: 'choice',
411 | answerValueSet: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.11.20.9.38',
412 | },
413 | {
414 | linkId: 'veteran-status',
415 | text: 'Veteran Status',
416 | type: 'boolean',
417 | },
418 | {
419 | linkId: 'pregnancy-status',
420 | text: 'Pregnancy Status',
421 | type: 'choice',
422 | code: [
423 | {
424 | code: '82810-3',
425 | display: 'Pregnancy status',
426 | system: 'http://loinc.org',
427 | },
428 | ],
429 | answerValueSet: 'http://example.com/pregnancy-status',
430 | },
431 | {
432 | linkId: 'estimated-delivery-date',
433 | text: 'Estimated Delivery Date',
434 | type: 'date',
435 | code: [
436 | {
437 | code: '11778-8',
438 | display: 'Estimated date of delivery',
439 | system: 'http://loinc.org',
440 | },
441 | ],
442 | enableWhen: [
443 | {
444 | question: 'pregnancy-status',
445 | operator: '=',
446 | answerCoding: {
447 | system: 'http://snomed.info/sct',
448 | code: '77386006',
449 | display: 'Pregnancy',
450 | },
451 | },
452 | ],
453 | },
454 | ],
455 | },
456 | {
457 | linkId: 'languages-spoken',
458 | text: 'Languages Spoken',
459 | type: 'choice',
460 | answerValueSet: 'http://hl7.org/fhir/ValueSet/languages',
461 | repeats: true,
462 | },
463 | {
464 | linkId: 'preferred-language',
465 | text: 'Preferred Language',
466 | type: 'choice',
467 | answerValueSet: 'http://hl7.org/fhir/ValueSet/languages',
468 | },
469 | {
470 | linkId: 'consent-for-treatment',
471 | text: 'Consent for Treatment',
472 | type: 'group',
473 | item: [
474 | {
475 | linkId: 'consent-for-treatment-signature',
476 | text: 'I the undersigned patient (or authorized representative, or parent/guardian), consent to and authorize the performance of any treatments, examinations, medical services, surgical or diagnostic procedures, including lab and radiographic studies, as ordered by this office and it’s healthcare providers.',
477 | type: 'boolean',
478 | },
479 | {
480 | linkId: 'consent-for-treatment-date',
481 | text: 'Date',
482 | type: 'date',
483 | },
484 | ],
485 | },
486 | {
487 | linkId: 'agreement-to-pay-for-treatment',
488 | text: 'Agreement to Pay for Treatment',
489 | type: 'group',
490 | item: [
491 | {
492 | linkId: 'agreement-to-pay-for-treatment-help',
493 | text: 'I, the responsible party, hereby agree to pay all the charges submitted by this office during the course of treatment for the patient. If the patient has insurance coverage with a managed care organization, with which this office has a contractual agreement, I agree to pay all applicable co‐payments, co‐insurance and deductibles, which arise during the course of treatment for the patient. The responsible party also agrees to pay for treatment rendered to the patient, which is not considered to be a covered service by my insurer and/or a third party insurer or other payor. I understand that Sample Hospital provides charges on a sliding fee; based on family size and household annual income, and that services will not be refused due to inability to pay at the time of the visit.',
494 | type: 'boolean',
495 | },
496 | {
497 | linkId: 'agreement-to-pay-for-treatment-date',
498 | text: 'Date',
499 | type: 'date',
500 | },
501 | ],
502 | },
503 | {
504 | linkId: 'notice-of-privacy-practices',
505 | text: 'Notice of Privacy Practices',
506 | type: 'group',
507 | item: [
508 | {
509 | linkId: 'notice-of-privacy-practices-help',
510 | text: 'Sample Hospital Notice of Privacy Practices gives information about how Sample Hospital may use and release protected health information (PHI) about you. I understand that:\n- I have the right to receive a copy of Sample Hospital’s Notice of Privacy Practices.\n- I may request a copy at any time.\n- Sample Hospital‘s Notice of Privacy Practices may be revised.',
511 | type: 'display',
512 | },
513 | {
514 | linkId: 'notice-of-privacy-practices-signature',
515 | text: 'I acknowledge the above and that I have received a copy of Sample Hospital’s Notice of Privacy Practices.',
516 | type: 'boolean',
517 | },
518 | {
519 | linkId: 'notice-of-privacy-practices-date',
520 | text: 'Date',
521 | type: 'date',
522 | },
523 | ],
524 | },
525 | {
526 | linkId: 'acknowledgement-for-advance-directives',
527 | text: 'Acknowledgement for Advance Directives',
528 | type: 'group',
529 | item: [
530 | {
531 | linkId: 'acknowledgement-for-advance-directives-help',
532 | text: 'An Advance Medical Directive is a document by which a person makes provision for health care decisions in the event that, in the future, he/she becomes unable to make those decisions.',
533 | type: 'display',
534 | },
535 | {
536 | linkId: 'acknowledgement-for-advance-directives-signature',
537 | text: 'I acknowledge I have received information about Advance Directives.',
538 | type: 'boolean',
539 | },
540 | {
541 | linkId: 'acknowledgement-for-advance-directives-date',
542 | text: 'Date',
543 | type: 'date',
544 | },
545 | ],
546 | },
547 | ],
548 | };
549 |
--------------------------------------------------------------------------------