Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Sep 20, 2024
1 parent eca8151 commit ddf629a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 51 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/data/PatientResultsTableHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const patientSearchHeaderData = [
{
key: "nationalId",
header: <FormattedMessage id="patient.natioanalid" />,
},
},
{
key: "dataSourceName",
header: <FormattedMessage id="patient.dataSourceName" />,
Expand Down
106 changes: 59 additions & 47 deletions frontend/src/components/patient/SearchPatientForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,63 +433,75 @@ function SearchPatientForm(props) {
<TableRow>
<TableHeader />
{headers.map((header) => (
<TableHeader key={header.key} {...getHeaderProps({ header })}>
<TableHeader
key={header.key}
{...getHeaderProps({ header })}
>
{header.header}
</TableHeader>
))}
</TableRow>
</TableHead>
<TableBody>
{rows.slice((page - 1) * pageSize, page * pageSize).map((row) => {
const dataSourceName = row.cells.find(
(cell) => cell.info.header === "dataSourceName"
)?.value;

return (
<TableRow key={row.id}>
<TableCell>
{dataSourceName === "OpenElis" ? (
<RadioButton
name="radio-group"
onClick={patientSelected}
labelText=""
id={row.id}
/>
) : (
<span></span>
)}
</TableCell>
{rows
.slice((page - 1) * pageSize, page * pageSize)
.map((row) => {
const dataSourceName = row.cells.find(
(cell) => cell.info.header === "dataSourceName",
)?.value;

{row.cells.map((cell) => (
<TableCell key={cell.id}>
{cell.info.header === "dataSourceName" ? (
<><Tag
type={cell.value === "OpenElis" ? "red" : cell.value === "Open Client Registry" ? "green" : "gray"}
>
{cell.value}
</Tag>
&nbsp;&nbsp;
&nbsp;&nbsp;
&nbsp;&nbsp;
{dataSourceName === "Open Client Registry" ? (
<Button
kind="tertiary"
onClick={() => importPatient(row.id)}
size="md"
>
<Person size={16} />
<span>&nbsp;&nbsp;Import Patient</span>
</Button>
) : (<span></span>)}
</>
return (
<TableRow key={row.id}>
<TableCell>
{dataSourceName === "OpenElis" ? (
<RadioButton
name="radio-group"
onClick={patientSelected}
labelText=""
id={row.id}
/>
) : (
cell.value
<span></span>
)}
</TableCell>
))}
</TableRow>
);
})}

{row.cells.map((cell) => (
<TableCell key={cell.id}>
{cell.info.header === "dataSourceName" ? (
<>
<Tag
type={
cell.value === "OpenElis"
? "red"
: cell.value === "Open Client Registry"
? "green"
: "gray"
}
>
{cell.value}
</Tag>
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
{dataSourceName === "Open Client Registry" ? (
<Button
kind="tertiary"
onClick={() => importPatient(row.id)}
size="md"
>
<Person size={16} />
<span>&nbsp;&nbsp;Import Patient</span>
</Button>
) : (
<span></span>
)}
</>
) : (
cell.value
)}
</TableCell>
))}
</TableRow>
);
})}
</TableBody>
</Table>
</TableContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.openelisglobal.note.valueholder.Note;
import org.openelisglobal.organization.valueholder.Organization;
import org.openelisglobal.patient.action.bean.PatientManagementInfo;
import org.openelisglobal.patient.valueholder.Patient;
import org.openelisglobal.provider.valueholder.Provider;
import org.openelisglobal.referral.action.beanitems.ReferralItem;
import org.openelisglobal.result.action.util.ResultsUpdateDataSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
import org.openelisglobal.patient.action.bean.PatientManagementInfo;
import org.openelisglobal.patient.service.PatientService;
import org.openelisglobal.patient.valueholder.Patient;
import org.openelisglobal.person.service.PersonService;
import org.openelisglobal.person.valueholder.Person;
import org.openelisglobal.provider.service.ProviderService;
import org.openelisglobal.provider.valueholder.Provider;
Expand All @@ -111,7 +110,6 @@
import org.openelisglobal.samplehuman.service.SampleHumanService;
import org.openelisglobal.sampleitem.service.SampleItemService;
import org.openelisglobal.sampleitem.valueholder.SampleItem;
import org.openelisglobal.spring.util.SpringContext;
import org.openelisglobal.test.service.TestService;
import org.openelisglobal.test.valueholder.Test;
import org.openelisglobal.typeofsample.service.TypeOfSampleService;
Expand Down

0 comments on commit ddf629a

Please sign in to comment.