Skip to content

Commit cb2e81d

Browse files
committed
fix(capinov): corrige la gestion des Non Quantifié, et corrige une référence (#385)
1 parent 4d49082 commit cb2e81d

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

server/services/imapService/capinov.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,58 @@ describe('Parse correctement le fichier CSV', () => {
124124
});
125125
});
126126

127+
test('<LQ et "d, NQ" sont équivalent', () => {
128+
const defaultLine = {
129+
PREFIXE_NOM: '2025',
130+
DEMANDE_NUMERO: '0003',
131+
ECHANT_NUMERO: '1',
132+
LOT: 'ARA-1234-333-1',
133+
PARAMETRE_NOM: 'SAP00010',
134+
RESULTAT_VALTEXTE: 'nd',
135+
RESULTAT_VALNUM: '0',
136+
PARAMETRE_LIBELLE: 'Acephate',
137+
LIMITE_LQ: '0.01',
138+
INCERTITUDE: '0',
139+
CAS_NUMBER: '135158-54-2',
140+
TECHNIQUE: 'MI MO-PC-077',
141+
LMR_NUM: '0,01',
142+
ECHANT_DATE_DIFFUSION: '16/04/2025',
143+
COMMENTAIRE: 'Pas de problème'
144+
};
145+
146+
const lines = [
147+
{ ...defaultLine, RESULTAT_VALTEXTE: 'd, NQ' },
148+
{ ...defaultLine, RESULTAT_VALTEXTE: '< LQ' }
149+
];
150+
expect(extractAnalyzes(lines)).toMatchInlineSnapshot(`
151+
[
152+
{
153+
"capinovRef": "2025 0003 1",
154+
"notes": "Pas de problème",
155+
"residues": [
156+
{
157+
"analysisDate": "2025-04-16",
158+
"analysisMethod": "Multi",
159+
"casNumber": "135158-54-2",
160+
"codeSandre": null,
161+
"label": "Acephate",
162+
"result_kind": "NQ",
163+
},
164+
{
165+
"analysisDate": "2025-04-16",
166+
"analysisMethod": "Multi",
167+
"casNumber": "135158-54-2",
168+
"codeSandre": null,
169+
"label": "Acephate",
170+
"result_kind": "NQ",
171+
},
172+
],
173+
"sampleReference": "ARA-1234-333",
174+
},
175+
]
176+
`);
177+
});
178+
127179
test('getAnalysisKeyByFileName', () => {
128180
expect(
129181
getAnalysisKeyByFileName(

server/services/imapService/capinov.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const capinovReferential: Record<string, SSD2Id> = {
4040
Bromuconazole: 'RF-0054-001-PPP',
4141
'Captan + tetrahydrophtaIimide expr. as captan': 'RF-00004681-PAR',
4242
Carbetamide: 'RF-00012044-PAR',
43-
'Carbofuran (+ 3-hydroxy-carbofuran expr. as carbofuran)': 'RF-0065-002-PPP',
43+
'Carbofuran (+ 3-hydroxy-carbofuran expr. as carbofuran)': 'RF-00003374-PAR',
4444
'Carboxin (+Carboxin-sulfoxide + carboxin-sulfone (Oxycarboxin) expr. as carboxin)':
4545
'RF-00011559-PAR',
4646
'Carfentrazone-ethyl (sum of carfentrazone-ethyl and carfentrazone, expr. as carfentrazone-ethyl)':
@@ -874,7 +874,8 @@ export const extractAnalyzes = (
874874
const result: ExportResultQuantifiable | ExportResultNonQuantifiable =
875875
!isDetectable
876876
? { result_kind: 'ND' }
877-
: residue.RESULTAT_VALTEXTE === 'd, NQ'
877+
: residue.RESULTAT_VALTEXTE === 'd, NQ' ||
878+
residue.RESULTAT_VALTEXTE === '< LQ'
878879
? {
879880
result_kind: 'NQ'
880881
}

shared/referential/Residue/SSD2Hierarchy.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,13 @@ export const SSD2Hierarchy: { [reference in SSD2Id]?: SSD2Id[] } =
322322
'RF-0662-001-PPP',
323323
'RF-0663-001-PPP'
324324
],
325-
'RF-1006-001-PPP': ['RF-0397-001-PPP']
325+
'RF-1006-001-PPP': ['RF-0397-001-PPP'],
326+
'RF-0396-001-PPP': [
327+
'RF-00003330-PAR',
328+
'RF-00003331-PAR',
329+
'RF-00003332-PAR',
330+
'RF-00003333-PAR'
331+
]
326332
};
327333
// ----- ne pas supprimer cette ligne : fin
328334

0 commit comments

Comments
 (0)