Skip to content

Commit 103a53d

Browse files
✨ feat(documents): Display all parsed reports nicely formatted.
Not just the ones in the HealthOne format, also the ones in the Medidoc format.
1 parent e562cd7 commit 103a53d

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

imports/ui/documents/DocumentCard.tsx

+23-23
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ const DocumentCardListItem = ({document}: DocumentCardListItemProps) => {
186186

187187
if (parsed) {
188188
// eslint-disable-next-line default-case
189-
switch (format) {
190-
case 'healthone': {
189+
switch (kind) {
190+
case 'lab': {
191191
// eslint-disable-next-line default-case
192-
switch (kind) {
193-
case 'lab': {
192+
switch (format) {
193+
case 'healthone': {
194194
return (
195195
<ListItem>
196196
<ListItemAvatar>
@@ -206,26 +206,26 @@ const DocumentCardListItem = ({document}: DocumentCardListItemProps) => {
206206
</ListItem>
207207
);
208208
}
209-
210-
case 'report': {
211-
return (
212-
<ListItem>
213-
<ListItemAvatar>
214-
<Avatar>
215-
<SubjectIcon />
216-
</Avatar>
217-
</ListItemAvatar>
218-
<ListItemText
219-
disableTypography
220-
primary={
221-
<Typography variant="subtitle1">Contents</Typography>
222-
}
223-
secondary={<ReportContents document={document} />}
224-
/>
225-
</ListItem>
226-
);
227-
}
228209
}
210+
211+
break;
212+
}
213+
214+
case 'report': {
215+
return (
216+
<ListItem>
217+
<ListItemAvatar>
218+
<Avatar>
219+
<SubjectIcon />
220+
</Avatar>
221+
</ListItemAvatar>
222+
<ListItemText
223+
disableTypography
224+
primary={<Typography variant="subtitle1">Contents</Typography>}
225+
secondary={<ReportContents document={document} />}
226+
/>
227+
</ListItem>
228+
);
229229
}
230230
}
231231
}

0 commit comments

Comments
 (0)