Skip to content

Commit

Permalink
Merge pull request #76 from chronic-care/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
swmuir authored Jun 28, 2024
2 parents 7b20bda + 8ea4410 commit fceeaad
Show file tree
Hide file tree
Showing 6 changed files with 16,283 additions and 14,215 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ REACT_APP_LOG_ENABLED=false
REACT_APP_LOG_API_KEY=<...>
REACT_APP_LOG_ENDPOINT_URI="http://localhost:8085"

REACT_APP_VERSION="version - 2.2.1"
REACT_APP_VERSION="version - 2.2.2"
# Set to have HHS Banner
REACT_APP_HHS_BANNER=false
27 changes: 18 additions & 9 deletions src/components/edit-forms/GoalEditForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
// import { useParams } from 'react-router';
import { useHistory } from 'react-router-dom'
import { useHistory, useLocation } from 'react-router-dom'
import moment from 'moment';

import AdapterDateFns from '@mui/lab/AdapterDateFns';
import Box from '@mui/material/Box';
Expand All @@ -17,10 +18,18 @@ import { createSharedDataResource } from '../../data-services/fhirService';

export default function GoalEditForm(formData?: EditFormData) {
let history = useHistory()
// const id = useParams();
const [description, setDescription] = React.useState<string | null>('');
const [startDate, setStartDate] = React.useState<Date | null>(new Date());
const [dueDate, setDueDate] = React.useState<Date | null>(null);
const location = useLocation();
const prepopulatedDescription = (location.state as { prepopulatedDescription?: string })?.prepopulatedDescription ?? '';
const prepopulatedDate = (location.state as { prepopulatedDate?: Date })?.prepopulatedDate ?? null;
const prepopulatedDueDate = (location.state as {prepopulatedDueDate?: Date})?.prepopulatedDueDate ?? null;
const [description, setDescription] = React.useState<string>(prepopulatedDescription);
const [startDate, setStartDate] = React.useState<Date | null>(
prepopulatedDate ? moment(prepopulatedDate).add(0, 'day').toDate() : null
);

const [dueDate, setDueDate] = React.useState<Date | null>(
prepopulatedDueDate ? moment(prepopulatedDueDate).add(0, 'day').toDate() : null
);

const patientID = formData?.supplementalDataClient?.getPatientId()
const patientName: string | null = null // TODO: find patient with matching ID from formData?patientSummaries
Expand Down Expand Up @@ -131,13 +140,13 @@ export default function GoalEditForm(formData?: EditFormData) {
</Grid>

<Grid item xs={12} sm={6}>
<Button type="submit" fullWidth variant="contained" sx={{ mt: 3, bgcolor: '#355CA8' }}>
Save
<Button type="reset" fullWidth variant="outlined" sx={{ mt: 3, color: '#355CA8', bgcolor: '#F7F7F7', bordercolor: '#355CA8' }}>
Cancel
</Button>
</Grid>
<Grid item xs={12} sm={6}>
<Button type="reset" fullWidth variant="outlined" sx={{ mt: 3, color: '#355CA8', bgcolor: '#F7F7F7', bordercolor: '#355CA8' }}>
Cancel
<Button type="submit" fullWidth variant="contained" sx={{ mt: 3, bgcolor: '#355CA8' }}>
Save
</Button>
</Grid>

Expand Down
8 changes: 4 additions & 4 deletions src/components/summaries/ConditionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ export const ConditionList: FC<ConditionListProps> = ({ fhirDataCollection, cond
// Apply sorting
switch (sortingOption) {
case 'alphabetical-az':
combinedConditions.sort((a, b) => (a.condition.ConceptName || '').localeCompare(b.condition.ConceptName || ''));
combinedConditions.sort((a, b) => (a.condition.CommonName || '').localeCompare(b.condition.CommonName || ''));
break;
case 'alphabetical-za':
combinedConditions.sort((a, b) => (b.condition.ConceptName || '').localeCompare(a.condition.ConceptName || ''));
combinedConditions.sort((a, b) => (b.condition.CommonName || '').localeCompare(a.condition.CommonName || ''));
break;
case 'newest':
combinedConditions.sort((a, b) => (b.condition.OnsetDate || '').localeCompare(a.condition.OnsetDate || ''));
combinedConditions.sort((a, b) => (b.condition.RecordedDate || '').localeCompare(a.condition.RecordedDate || ''));
break;
case 'oldest':
combinedConditions.sort((a, b) => (a.condition.OnsetDate || '').localeCompare(b.condition.OnsetDate || ''));
combinedConditions.sort((a, b) => (a.condition.RecordedDate || '').localeCompare(b.condition.RecordedDate || ''));
break;
default:
break;
Expand Down
28 changes: 28 additions & 0 deletions src/components/summaries/GoalList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Summary, SummaryRowItem, SummaryRowItems } from './Summary';
import { BusySpinner } from '../busy-spinner/BusySpinner';
import { SortModal } from '../sort-modal/sortModal';
import { SortOnlyModal } from '../sort-only-modal/sortOnlyModal';
import EditIcon from '@mui/icons-material/Edit';

interface GoalListProps {
fhirDataCollection?: FHIRData[];
Expand Down Expand Up @@ -180,6 +181,33 @@ const buildRows = (goal: GoalSummary, theSource?: string): SummaryRowItems => {
data2: goal.StartDate === null ? '' : 'Start: ' + goal.StartDate,
},
];
//add "SDS Data" instead of "Data SDS"
if (theSource === 'Data SDS') {
rows.unshift({
isHeader: false,
twoColumns: false,
data1: (
<>
<Link
to={{
pathname: '/goal-edit',
state: {
goalData: goal,
prepopulatedDescription: goal.Description,
prepopulatedDate: goal.StartDate || null,
prepopulatedDueDate: goal?.Target?.[0]?.DueDate || null
}
}}
>
<div style={{ color: '#355CA8', textAlign: 'right', marginLeft: 'auto' }}>
<EditIcon/>
</div>
</Link>
</>
),
data2: '',
});
}

const targets: SummaryRowItems = buildTargets(goal);
if (targets?.length) {
Expand Down
2 changes: 1 addition & 1 deletion src/data-services/cql/mcc/DataElementHelpers.cql
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ define function ReportCondition(condition Condition, category String, commonName
{
id: condition.id.value,
Category: category,
CommonName: commonName,
CommonName: Coalesce(commonName, ConceptText(condition.code)),
ConceptName: ConceptText(condition.code),
CodeableConcept: condition.code,
RecordedDate: ToString(condition.recordedDate),
Expand Down
Loading

0 comments on commit fceeaad

Please sign in to comment.