Skip to content

Commit

Permalink
Merge pull request #437 from masslight/develop
Browse files Browse the repository at this point in the history
Loire release
  • Loading branch information
GiladSchneider authored Sep 23, 2024
2 parents 17f6567 + 3691f8e commit 8b6337d
Show file tree
Hide file tree
Showing 35 changed files with 115 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-telemed-ehr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on:
description: 'Environment name'
required: true
type: choice
default: 'dev'
default: 'development'
options:
- dev
- development
- dev2
- testing
- staging
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-telemed-intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on:
description: 'Environment name'
required: true
type: choice
default: 'dev'
default: 'development'
options:
- dev
- development
- dev2
- testing
- staging
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
name: 'secrets.json'
json: ${{ secrets.OTTEHR_SECRETS_JSON }}

- name: Set the telemed-ehr/zambdas/.env/dev.json
run: cp packages/telemed-ehr/zambdas/.env/local.template.json packages/telemed-ehr/zambdas/.env/dev.json
- name: Set the telemed-ehr/zambdas/.env/development.json
run: cp packages/telemed-ehr/zambdas/.env/local.template.json packages/telemed-ehr/zambdas/.env/development.json

- name: Set the telemed-intake/zambdas/.env/dev.json
run: cp packages/telemed-intake/zambdas/.env/local.template.json packages/telemed-intake/zambdas/.env/dev.json
- name: Set the telemed-intake/zambdas/.env/development.json
run: cp packages/telemed-intake/zambdas/.env/local.template.json packages/telemed-intake/zambdas/.env/development.json

- name: Set the urgent-care-intake/zambdas/.env/dev.json
run: cp packages/urgent-care-intake/zambdas/.env/local.template.json packages/urgent-care-intake/zambdas/.env/dev.json
- name: Set the urgent-care-intake/zambdas/.env/development.json
run: cp packages/urgent-care-intake/zambdas/.env/local.template.json packages/urgent-care-intake/zambdas/.env/development.json

- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ottehr",
"version": "0.11.0",
"version": "0.12.0",
"private": true,
"scripts": {
"test": "pnpm recursive run test",
Expand Down Expand Up @@ -129,6 +129,7 @@
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react-hooks": "^4.6.0",
"happy-dom": "^12.10.3",
"html-entities": "2.5.2",
"husky": "^8.0.0",
"inquirer": "^8.0.0",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ehr-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ehr-utils",
"private": true,
"version": "0.11.0",
"version": "0.12.0",
"main": "lib/main.ts",
"types": "lib/main.ts",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ const CustomRadioButtonIcon: FC<CustomRadioIconProps> = ({
checked,
alt,
}: CustomRadioIconProps): JSX.Element => (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-label={alt}>
<circle cx="12" cy="12" r="12" fill={checked ? color.main : color.contrastText} />
<circle cx="12" cy="12" r="4" fill="white" />
<svg width="24" height="25" viewBox="0 0 24 26" fill="none" xmlns="http://www.w3.org/2000/svg" aria-label={alt}>
{checked ? (
<>
<circle cx="12" cy="12.5" r="12" fill={color.main} />
<circle cx="12" cy="12.5" r="4" fill="white" />
</>
) : (
<circle cx="12" cy="12.5" r="11.5" fill="white" stroke="#C3C9D2" />
)}
</svg>
);

Expand Down
2 changes: 1 addition & 1 deletion packages/ottehr-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ottehr-components",
"private": true,
"version": "0.11.0",
"version": "0.12.0",
"main": "lib/main.ts",
"types": "lib/main.ts",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/telemed-ehr/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "telemed-ehr-app",
"version": "0.11.0",
"version": "0.12.0",
"private": true,
"browserslist": {
"production": [
Expand Down Expand Up @@ -29,7 +29,7 @@
"build-skeleton": "tsc && vite build --mode ${ENV}",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy:dev": " PREFIX=development CLOUDFRONT_ID=E10TA6FN58D1OS ENV=dev pnpm run ci-deploy-skeleton",
"deploy:development": " PREFIX=development CLOUDFRONT_ID=E10TA6FN58D1OS ENV=dev pnpm run ci-deploy-skeleton",
"ci-deploy-skeleton": "ENV=${ENV} VITE_APP_SHA=${GIT_HEAD:-$(git rev-parse --short HEAD)} VITE_APP_VERSION=$(node -pe 'require(\"./package.json\").version') pnpm run build:dev && aws s3 sync build/ s3://ehr.ottehr.com --region us-east-1 --delete && aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths '/*' --region us-east-1"
},
"dependencies": {
Expand Down
Binary file added packages/telemed-ehr/app/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/telemed-ehr/app/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/telemed-ehr/app/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/telemed-ehr/app/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"sizes": "32x32 16x16",
"type": "image/x-icon"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export const createSampleAppointments = async (
console.log('Succesfully created appointments', responses);
} catch (error: any) {
console.error('Error creating appointments:', error);
} finally {
localStorage.removeItem('selectedLocationID');
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function EditStatePage(): JSX.Element {
const { fhirClient } = useApiClients();
const theme = useTheme();
const [isOperateInStateChecked, setIsOperateInStateChecked] = useState<boolean>(false);
const [stateName, setStateName] = useState<string | undefined>(undefined);
const { state } = useParams();
const fullLabel = `${state} - ${AllStatesToNames[state as StateType]}`;

Expand All @@ -39,12 +40,13 @@ export default function EditStatePage(): JSX.Element {
{
onSuccess: (location) => {
setIsOperateInStateChecked(Boolean(location && location.status === 'active'));
setStateName(location?.name);
},
},
);

const mutation = useMutation(({ location, newStatus }: { location: Location; newStatus: string }) =>
updateStateLocationStatus(fhirClient, location, newStatus),
updateStateLocationStatusAndName(fhirClient, location, newStatus, stateName ?? ''),
);

const onSwitchChange = (value: boolean): void => {
Expand All @@ -68,7 +70,7 @@ export default function EditStatePage(): JSX.Element {
{/* Breadcrumbs */}
<CustomBreadcrumbs
chain={[
{ link: '/states', children: 'States' },
{ link: '/telemed-admin/states', children: 'States' },
{ link: '#', children: fullLabel || <Skeleton width={150} /> },
]}
/>
Expand All @@ -92,16 +94,19 @@ export default function EditStatePage(): JSX.Element {
</FormLabel>

<Box sx={{ marginTop: '10px' }}>
<TextField
id="outlined-read-only-input"
label="State name"
value={fullLabel}
sx={{ marginBottom: 2 }}
margin="dense"
InputProps={{
readOnly: true,
}}
/>
{isFetching ? (
<Skeleton width={195} height={75} sx={{ marginBottom: 1 }} />
) : (
<TextField
id="outlined-input"
label="State name"
value={stateName}
onChange={(e) => setStateName(e.target.value)}
sx={{ marginBottom: 2 }}
margin="dense"
required
/>
)}
</Box>
<Box>
{isFetching ? (
Expand Down Expand Up @@ -169,10 +174,10 @@ async function getStateLocation(fhirClient: FhirClient, state: StateType): Promi
name: 'address-state',
value: state,
},
{
name: 'name:contains',
value: 'virtual',
},
// {
// name: 'name:contains',
// value: 'virtual',
// },
],
})) as Location[];

Expand All @@ -183,10 +188,11 @@ async function getStateLocation(fhirClient: FhirClient, state: StateType): Promi
);
}

async function updateStateLocationStatus(
async function updateStateLocationStatusAndName(
fhirClient: FhirClient,
location: Location,
status: string,
name: string,
): Promise<Location | undefined> {
const updatedLocation = await fhirClient.patchResource<Location>({
resourceType: 'Location',
Expand All @@ -197,6 +203,11 @@ async function updateStateLocationStatus(
path: '/status',
value: status,
},
{
op: location.name ? 'replace' : 'add',
path: '/name',
value: name,
},
],
});
return updatedLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function StatesPage(): ReactElement {
{/* Label Row */}
<TableHead>
<TableRow>
<TableCell sx={{ fontWeight: 'bold', width: '50%' }}>State name</TableCell>
<TableCell sx={{ fontWeight: 'bold', width: '50%' }}>State</TableCell>
<TableCell sx={{ fontWeight: 'bold' }} align="left">
Operate in state
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export const useStatesQuery = () => {
name: 'address-state:missing',
value: 'false',
},
{
name: 'name:contains',
value: 'virtual',
},
// {
// name: 'name:contains',
// value: 'virtual',
// },
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ const CreateDemoVisits = (): ReactElement => {
const { getAccessTokenSilently } = useAuth0();

const handleCreateSampleAppointments = async (phoneNumber: string): Promise<void> => {
if (!phoneNumber || phoneNumber.length < 10 || !phoneNumber.startsWith('+1')) {
if (!phoneNumber || phoneNumber.length !== 12 || !phoneNumber.startsWith('+1')) {
setInputError(true);
return;
}
try {
setLoading(true);
setInputError(false);
const authToken = await getAccessTokenSilently();
const response = await createSampleAppointments(fhirClient, authToken, phoneNumber);
const formattedPhoneNumber = phoneNumber.slice(2);
const response = await createSampleAppointments(fhirClient, authToken, formattedPhoneNumber);
console.log('response', response);
setSnackbar({
open: true,
Expand Down Expand Up @@ -62,7 +63,7 @@ const CreateDemoVisits = (): ReactElement => {

const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => {
setPhoneNumber(e.target.value);
if (e.target.value.length === 11 && e.target.value.startsWith('+1')) {
if (e.target.value.length === 12 && e.target.value.startsWith('+1')) {
setInputError(false);
}
};
Expand Down Expand Up @@ -108,7 +109,7 @@ const CreateDemoVisits = (): ReactElement => {
}}
required
error={inputError}
helperText={inputError ? 'Please enter a valid phone number in the format +1234567890' : ''}
helperText={inputError ? 'Please enter a valid phone number in the format +12345678900' : ''}
/>
<LoadingButton
loading={loading}
Expand Down
4 changes: 2 additions & 2 deletions packages/telemed-ehr/zambdas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "telemed-ehrzambdas",
"version": "0.11.0",
"version": "0.12.0",
"private": true,
"scripts": {
"start": "npm run start:local",
Expand All @@ -14,7 +14,7 @@
"debug": "export SLS_DEBUG=* && node --inspect ../../../node_modules/serverless/bin/serverless offline --stage=local",
"setup-zapehr-secrets": "ts-node scripts/configure-zapehr-secrets.ts ${ENV}",
"deploy-zambdas": "pnpm run package && ts-node scripts/deploy-zambdas.ts ${ENV}",
"build": "tsc && sls package --stage dev",
"build": "tsc && sls package --stage development",
"lint": "eslint . --ext ts --report-unused-disable-directives --max-warnings 0",
"package": "tsc && sls package && npm run rebundle",
"rebundle": "bash scripts/package-for-release.sh"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import devConfig from '../.env/dev.json';
import devConfig from '../.env/development.json';
// import testingConfig from '../.env/testing.json';
import { getAuth0Token } from '../src/shared';
import { ZambdaClient } from '@zapehr/sdk';
Expand Down Expand Up @@ -34,7 +34,7 @@ const main = async (): Promise<void> => {
const env = process.argv[2];

switch (env) {
case 'dev':
case 'development':
await setupSecrets(devConfig);
break;
// case 'testing':
Expand Down
2 changes: 1 addition & 1 deletion packages/telemed-ehr/zambdas/scripts/deploy-zambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const ZAMBDAS: { [name: string]: DeployZambda } = {
schedule: {
expression: 'cron(*/5 * * * ? *)', // every 3 minutes
},
environments: ['dev', 'testing', 'staging', 'training'],
environments: ['development', 'testing', 'staging', 'training'],
},
'SYNC-USER': {
type: 'http_auth',
Expand Down
2 changes: 1 addition & 1 deletion packages/telemed-intake/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.png" />
<link rel="icon" href="./public/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ottehr Telemedicine</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions packages/telemed-intake/app/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "telemed-intake-app",
"private": true,
"version": "0.11.0",
"version": "0.12.0",
"type": "module",
"scripts": {
"start:local": "vite",
"build:dev": "tsc && vite build --mode dev",
"build": "tsc && vite build",
"deploy:dev": "PREFIX=development CLOUDFRONT_ID=EIYX001DGGQK8 ENV=dev pnpm run ci-deploy-skeleton",
"deploy:development": "PREFIX=development CLOUDFRONT_ID=EIYX001DGGQK8 ENV=dev pnpm run ci-deploy-skeleton",
"ci-deploy-skeleton": "ENV=${ENV} VITE_APP_SHA=${GIT_HEAD:-$(git rev-parse --short HEAD)} VITE_APP_VERSION=$(node -pe 'require(\"./package.json\").version') pnpm run build:dev && aws s3 sync build/ s3://telemed.ottehr.com --region us-east-1 --delete && aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths '/*' --region us-east-1"
},
"dependencies": {
Expand Down
Binary file added packages/telemed-intake/app/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/telemed-intake/app/public/favicon.ico
Binary file not shown.
15 changes: 15 additions & 0 deletions packages/telemed-intake/app/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "Ottehr EHR",
"name": "Ottehr EHR",
"icons": [
{
"src": "favicon.ico",
"sizes": "32x32 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Loading

0 comments on commit 8b6337d

Please sign in to comment.