-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ccc and patient name to manifest samples table and flu sample types #498
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ import React from 'react'; | |
import { useTranslation } from 'react-i18next'; | ||
import styles from '../tables/lab-manifest-table.scss'; | ||
import { LabManifestSample } from '../types'; | ||
import PatientNameCell from '../tables/patient-name-cell.component'; | ||
import PatientCCCNumbercell from '../tables/patient-ccc-no-cell.component'; | ||
|
||
interface SampleDeleteConfirmDialogProps { | ||
onClose: () => void; | ||
|
@@ -30,7 +32,11 @@ const SampleDeleteConfirmDialog: React.FC<SampleDeleteConfirmDialogProps> = ({ o | |
|
||
const headers = [ | ||
{ | ||
header: t('patientIdentifier', 'Patient Identifier'), | ||
header: t('patient', 'Patient'), | ||
key: 'patient', | ||
}, | ||
{ | ||
header: t('cccKDODNumber', 'CCC/KDOD Number'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the KDOD number same as ccc number? I can't remember cc @njorocs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thats how it was named in 2.x, unless they are different There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just saw that we have kdod identifier type, should it check for ccc, if not found then look for kdod identifier for the patient?and if all are available which one should be displayed? cc @PatrickWaweru @donaldkibet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It depends on the system type. If it is a KDOD system, display KDOD. Else, display CCC. |
||
key: 'cccKDODNumber', | ||
}, | ||
{ | ||
|
@@ -62,7 +68,12 @@ const SampleDeleteConfirmDialog: React.FC<SampleDeleteConfirmDialogProps> = ({ o | |
sampleType: sample.sampleType ?? '--', | ||
status: sample.status, | ||
batchNumber: sample.batchNumber ?? '--', | ||
cccKDODNumber: sample?.order?.patient?.identifiers[0]?.identifier ?? '--', | ||
patient: sample?.order?.patient?.uuid ? <PatientNameCell patientUuid={sample?.order?.patient?.uuid} /> : '--', | ||
cccKDODNumber: sample?.order?.patient?.uuid ? ( | ||
<PatientCCCNumbercell patientUuid={sample?.order?.patient?.uuid} /> | ||
) : ( | ||
'--' | ||
), | ||
dateRequested: sample.dateSent ? formatDate(parseDate(sample.dateSent)) : '--', | ||
resultDate: sample.resultDate ? formatDate(parseDate(sample.resultDate)) : '--', | ||
result: sample.result ?? '--', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework'; | ||
import useSWR from 'swr'; | ||
|
||
const usePatient = (patientUuid: string) => { | ||
const customerep = 'custom:(person:(display),identifiers:(identifier,identifierType:(uuid)))'; | ||
const url = `${restBaseUrl}/patient/${patientUuid}?v=${customerep}`; | ||
const { data, error, isLoading } = useSWR< | ||
FetchResponse<{ | ||
person: { display: string }; | ||
identifiers: Array<{ identifier: string; identifierType: { uuid: string } }>; | ||
}> | ||
>(url, openmrsFetch); | ||
return { patient: data?.data, error, isLoading }; | ||
}; | ||
|
||
export default usePatient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just have the ccc identifier type or should it be an array of identifiers to be used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the manifest samples, the required identifier of interest was only ccc for verification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just found out we have kdod identifier type as well, so based on teams recommendation on bellow quoted question, i might change it as you have recommended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on the system type. If it is a KDOD system, display KDOD. Else, display CCC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @PatrickWaweru, @Omoshlawi we will have to check the global property to determine which identifier to show.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, FIXED cc @donaldkibet