Search in sources :

Example 1 with StatTransformerUtil

use of se.inera.intyg.webcert.notificationstub.v3.stat.StatTransformerUtil in project webcert by sklintyg.

the class NotificationStubRestApi method notifieringarV3Stats.

@GET
@Path("/notifieringar/v3/stats")
@Produces(MediaType.APPLICATION_JSON)
public Response notifieringarV3Stats() {
    Collection<se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareType> notifs = notificationStoreV3.getNotifications();
    Map<String, List<NotificationStubEntry>> stringListMap = new StatTransformerUtil().toStat(notifs);
    StringBuilder buf = new StringBuilder();
    for (Map.Entry<String, List<NotificationStubEntry>> entry : stringListMap.entrySet()) {
        buf.append("---- ").append(entry.getKey()).append(" ----\n");
        entry.getValue().stream().sorted(Comparator.comparing(NotificationStubEntry::getHandelseTid)).forEach(ie -> buf.append(ie.getHandelseTid().format(DateTimeFormatter.ofPattern("HH:mm:ss"))).append("\t").append(ie.getHandelseKod()).append("\n"));
        buf.append("-----------------------------------------------\n\n");
    }
    return Response.ok(buf.toString()).build();
}
Also used : CertificateStatusUpdateForCareType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.CertificateStatusUpdateForCareType) StatTransformerUtil(se.inera.intyg.webcert.notificationstub.v3.stat.StatTransformerUtil) NotificationStubEntry(se.inera.intyg.webcert.notificationstub.v3.stat.NotificationStubEntry) List(java.util.List) Map(java.util.Map) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

List (java.util.List)1 Map (java.util.Map)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 NotificationStubEntry (se.inera.intyg.webcert.notificationstub.v3.stat.NotificationStubEntry)1 StatTransformerUtil (se.inera.intyg.webcert.notificationstub.v3.stat.StatTransformerUtil)1 CertificateStatusUpdateForCareType (se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.CertificateStatusUpdateForCareType)1