Skip to content

Commit

Permalink
Slice the order id
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-learner committed Dec 27, 2024
1 parent e0216e9 commit f4fd9d4
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/LabTest/CollectSpecimen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const CollectSpecimen: React.FC<{
</span>
<div className="flex items-center gap-2">
<span className="text-lg font-semibold text-gray-900">
{data?.request.id}
{data?.request.id.slice(0, 8)}
</span>
<span className="px-2 py-1 text-xs font-medium bg-orange-100 text-orange-900 rounded">
Active
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/InProcess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const InProcess: React.FC = () => {
data={
data?.results?.map((specimen) => ({
specimenId: specimen.identifier ?? specimen.id.slice(0, 8),
orderId: specimen.request.id,
orderId: specimen.request.id.slice(0, 8),
patientName: specimen.subject.name,
specimen: specimen.type.display || specimen.type.code,
tests: specimen.request.code.display || specimen.request.code.code,
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/OrderPlaced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const OrderPlaced: React.FC = () => {
data={
data?.results?.map((specimen) => ({
specimenId: specimen.identifier ?? specimen.id.slice(0, 8),
orderId: specimen.request.id,
orderId: specimen.request.id.slice(0, 8),
patientName: specimen.subject.name,
specimen: specimen.type.display || specimen.type.code,
tests: specimen.request.code.display || specimen.request.code.code,
Expand Down
11 changes: 5 additions & 6 deletions src/components/LabTest/ProcessSpecimen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const ProcessSpecimen = ({ specimenId }: ProcessSpecimenProps) => {
Order ID
</Label>
<span className="block text-gray-900 font-semibold mt-1">
{specimen.request.id}
{specimen.request.id.slice(0, 8)}
</span>
</div>
<div>
Expand Down Expand Up @@ -702,10 +702,11 @@ export const ProcessSpecimen = ({ specimenId }: ProcessSpecimenProps) => {
id: uuid().toString(),
main_code: observation.code!,
value: observation.result,
status: "final",
status: "final" as "final",
effective_datetime: new Date().toISOString(),
data_entered_by_id: currentUserId,
subject_type: "patient",
subject_type: "patient" as "patient",
note: observation.note,
})),
},
},
Expand Down Expand Up @@ -757,9 +758,7 @@ export const ProcessSpecimen = ({ specimenId }: ProcessSpecimenProps) => {
<TableCell>{observation.value}</TableCell>
<TableCell>{observation.reference_range?.unit}</TableCell>
<TableCell>Dummy Ref range</TableCell>
<TableCell>
<p></p>
</TableCell>
<TableCell>{observation.note}</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
4 changes: 2 additions & 2 deletions src/components/LabTest/ReceiveSpecimen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const ReceiveSpecimen: React.FC = () => {
<div>
<h3 className="text-sm font-medium text-gray-600">Order ID</h3>
<p className="text-base font-semibold text-gray-900">
{scannedSpecimen.request.id}
{scannedSpecimen.request.id.slice(0, 8)}
</p>
</div>
</div>
Expand Down Expand Up @@ -382,7 +382,7 @@ export const ReceiveSpecimen: React.FC = () => {
Order ID
</h3>
<p className="text-base font-semibold text-gray-900">
{specimen.request.id}
{specimen.request.id.slice(0, 8)}
</p>
</div>
{/* Specimen Type */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/ReceivedAtLab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const ReceivedAtLab: React.FC = () => {
data={
data?.results?.map((specimen) => ({
specimenId: specimen.identifier ?? specimen.id.slice(0, 8),
orderId: specimen.request.id,
orderId: specimen.request.id.slice(0, 8),
patientName: specimen.subject.name,
specimen: specimen.type.display || specimen.type.code,
tests:
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/ReviewRequired.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const ReviewRequired: React.FC = () => {
data={
data?.results?.map((report) => ({
patientName: report.subject.name,
orderId: report.based_on.id,
orderId: report.based_on.id.slice(0, 8),
specimen: report.specimen
.map((specimen) => specimen.type.display || specimen.type.code)
.join(", "),
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/ReviewResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const ReviewResult: React.FC<{

return (
<div className="flex flex-col-reverse lg:flex-row min-h-screen">
{/* Left - Navigation/Progress Bar */}
{/* Left - Progress Bar */}
<ServiceRequestTimeline steps={steps} />

{/* Right - Main Content */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/SendSpecimen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const SendSpecimen: React.FC = () => {
</span>
<div className="flex items-center gap-2">
<span className="text-lg font-semibold text-gray-900">
SPEC009213
{specimen.identifier ?? specimen.id.slice(0, 8)}
</span>
<span className="px-2 py-1 text-xs font-medium bg-green-100 text-green-900 rounded">
Ready for Dispatch
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/SentToLab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const SentToLab: React.FC = () => {
data={
data?.results?.map((specimen) => ({
specimenId: specimen.identifier ?? specimen.id.slice(0, 8),
orderId: specimen.request.id,
orderId: specimen.request.id.slice(0, 8),
patientName: specimen.subject.name,
specimen: specimen.type.display || specimen.type.code,
tests:
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabTest/SpecimenCollected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const SpecimenCollected: React.FC = () => {
data={
data?.results?.map((specimen) => ({
specimenId: specimen.identifier ?? specimen.id.slice(0, 8),
orderId: specimen.request.id,
orderId: specimen.request.id.slice(0, 8),
patientName: specimen.subject.name,
specimen: specimen.type.display || specimen.type.code,
tests:
Expand Down

0 comments on commit f4fd9d4

Please sign in to comment.