Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release'
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Nov 20, 2024
2 parents d2d030c + 2e3ea4a commit f0ca329
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ private void processResults(List<ResultJSONDTO> results) {
}

for (ResultJSONDTO result : results) {
EsameEnum esame = EsameEnum.getCode(result.getId());
Integer idTest = result.getId();
EsameEnum esame = EsameEnum.getCode(idTest);
if (esame != null) {
checkValidation(esame, result,pdfFiles, out);
if(esame.isTest0(idTest))
out.unverifiableZero(idTest);
else
checkValidation(esame, result,pdfFiles, out);
} else {
out.unverifiable(result.getId());
out.unverifiable(idTest);
}
}
// Print res
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
public class ProcessResDTO {
private final Set<Integer> unverifiable;
private final Set<Integer> success;
private final Set<Integer> unverifiableZero;
private final Map<Integer, String> failures;

public ProcessResDTO() {
this.unverifiable = new TreeSet<>();
this.unverifiableZero = new TreeSet<>();
this.success = new TreeSet<>();
this.failures = new HashMap<>();
}
Expand All @@ -28,15 +30,22 @@ public void unverifiable(int id) {
unverifiable.add(id);
}

public void unverifiableZero(int id) {
unverifiableZero.add(id);
}

public void failure(int id, String issue) {
failures.putIfAbsent(id, issue);
}


public void print(Logger logger) {
logger.info("[TEST SUPERATI]");
logger.info(String.format("Test case OK con ids: %s", success));
logger.info("[TEST NON VERIFICABILI]");
logger.info(String.format("Test case KO con ids: %s", unverifiable));
logger.info("[TEST NON VERIFICABILI]");
logger.info(String.format("Test non sottoposto ad alcun validatore con ids: %s", unverifiableZero));
logger.info("[TEST FALLITI]");
logger.info(String.format("Test case KO con ids: %s", failures.keySet()));
logger.info("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*/
package it.finanze.sanita.gva.enums;

import java.util.ArrayList;
import java.util.List;

import it.finanze.sanita.gva.validator.CVACValidator;
import it.finanze.sanita.gva.validator.DocumentTypeValidator;
import it.finanze.sanita.gva.validator.LABValidator;
Expand Down Expand Up @@ -72,14 +75,35 @@ public enum EsameEnum {

//TRASFUSIONALE
TEST191TRASF(191, TipoDocEnum.REFERTO_LABORATORIO, TRASFValidator.class,"validateUC1"),
TEST376TRASF(376, TipoDocEnum.REFERTO_LABORATORIO, TRASFValidator.class,"validateUC2");
TEST376TRASF(376, TipoDocEnum.REFERTO_LABORATORIO, TRASFValidator.class,"validateUC2"),


//TEST 0
TEST0LAB(368, TipoDocEnum.REFERTO_LABORATORIO, LABValidator.class, null),
TEST0LDO(369, TipoDocEnum.LETTERA_DIMISSIONE_OSPEDALIERA, LDOValidator.class, null),
TEST0VACC(371, TipoDocEnum.CERTIFICATO_VACCINALE, CVACValidator.class,null),
TEST0SIN_VACC(372, TipoDocEnum.SCHEDA_SINGOLA_VACCINAZIONE, SVACValidator.class,null),
TEST0VPS(373, TipoDocEnum.VERBALE_PRONTO_SOCCORSO, VPSValidator.class,null),
TEST0RSA(374, TipoDocEnum.REFERTO_SPECIALISTICA_AMBULATORIALE, RSAValidator.class,null);
//PRS Missing
//PRF Missing
//RAP Missing

private Integer idTest;
private TipoDocEnum tipoDocumento;
private Class<? extends DocumentTypeValidator> validator;
private String methodName;

private static final List<Integer> TEST0_LIST;

static {
TEST0_LIST = new ArrayList<>();
TEST0_LIST.add(TEST0LAB.getIdTest());
TEST0_LIST.add(TEST0LDO.getIdTest());
TEST0_LIST.add(TEST0RSA.getIdTest());
TEST0_LIST.add(TEST0SIN_VACC.getIdTest());
TEST0_LIST.add(TEST0VPS.getIdTest());
TEST0_LIST.add(TEST0VACC.getIdTest());
}

public static EsameEnum getCode(final Integer inIdTest) {
EsameEnum out = null;
Expand All @@ -91,4 +115,11 @@ public static EsameEnum getCode(final Integer inIdTest) {
}
return out;
}

public boolean isTest0(Integer idTest){
if(TEST0_LIST.contains(idTest))
return true;

return false;
}
}

0 comments on commit f0ca329

Please sign in to comment.