Merge pull request 'Add logo home + ocr changes for TSI' (#20) from home_logo_plus_ocr into main
Build & Push Docker Images / Detect Changes (push) Successful in 10s
Build & Push Docker Images / Backend Tests (push) Successful in 1m53s
Build & Push Docker Images / Frontend Tests (push) Successful in 1m53s
Build & Push Docker Images / Build Backend (push) Successful in 21s
Build & Push Docker Images / Build Frontend (push) Successful in 33s
Build & Push Docker Images / Deploy (push) Successful in 23s
Build & Push Docker Images / Detect Changes (push) Successful in 10s
Build & Push Docker Images / Backend Tests (push) Successful in 1m53s
Build & Push Docker Images / Frontend Tests (push) Successful in 1m53s
Build & Push Docker Images / Build Backend (push) Successful in 21s
Build & Push Docker Images / Build Frontend (push) Successful in 33s
Build & Push Docker Images / Deploy (push) Successful in 23s
Reviewed-on: #20
This commit was merged in pull request #20.
This commit is contained in:
+2
-11
@@ -744,16 +744,8 @@ function extractCip(text) {
|
|||||||
return CARD_TEXT_PATTERNS.some(pattern => pattern.test(upper));
|
return CARD_TEXT_PATTERNS.some(pattern => pattern.test(upper));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Try to find barcodes first (typically numeric-heavy)
|
// TSI barcodes are alphanumeric like "803401INURO0890417003211T11"
|
||||||
// TSI barcodes are usually numeric or alphanumeric with mostly numbers
|
// Prioritize full alphanumeric matches (8-30 chars) before pure numeric
|
||||||
const numericMatches = cleaned.match(/\d{10,30}/g) || [];
|
|
||||||
for (const match of numericMatches) {
|
|
||||||
if (match.length >= 10 && match.length <= 30) {
|
|
||||||
return match.toUpperCase();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try exact 16-char alphanumeric match, but filter card text
|
|
||||||
const exact = cleaned.match(/[A-Z0-9]{16}/i);
|
const exact = cleaned.match(/[A-Z0-9]{16}/i);
|
||||||
if (exact) {
|
if (exact) {
|
||||||
const candidate = exact[0].toUpperCase();
|
const candidate = exact[0].toUpperCase();
|
||||||
@@ -762,7 +754,6 @@ function extractCip(text) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback: 8–30 alphanumeric chars, filter card text
|
|
||||||
const looseMatches = cleaned.match(/[A-Z0-9]{8,30}/gi) || [];
|
const looseMatches = cleaned.match(/[A-Z0-9]{8,30}/gi) || [];
|
||||||
for (const match of looseMatches) {
|
for (const match of looseMatches) {
|
||||||
const candidate = match.toUpperCase();
|
const candidate = match.toUpperCase();
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
@@ -6,7 +6,7 @@ function HomeView({ onScanClick, onSearchClick }) {
|
|||||||
<div className="home-view">
|
<div className="home-view">
|
||||||
<div className="home-hero">
|
<div className="home-hero">
|
||||||
<div className="home-logo-wrapper">
|
<div className="home-logo-wrapper">
|
||||||
<img src="/farmaclic_logo.png" alt="FarmaClic" className="home-logo" />
|
<img src="/farmaclic_logo_home.png" alt="FarmaClic" className="home-logo" />
|
||||||
<img src="/farmaclic_text.png" alt="FarmaClic" className="home-brand-name" />
|
<img src="/farmaclic_text.png" alt="FarmaClic" className="home-brand-name" />
|
||||||
</div>
|
</div>
|
||||||
<p className="home-desc">Encuentra tus medicamentos en farmacias cercanas</p>
|
<p className="home-desc">Encuentra tus medicamentos en farmacias cercanas</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user