@Test public void testConvertUtkastToListIntygEntrySetsUtkastStatusIfNoOtherAvailable() { ListIntygEntry res = IntygDraftsConverter.convertUtkastToListIntygEntry(createUtkast()); assertNotNull(res); assertEquals(UtkastStatus.DRAFT_INCOMPLETE.name(), res.getStatus()); }
public static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast) { ListIntygEntry entry = new ListIntygEntry(); entry.setIntygId(utkast.getIntygsId()); entry.setIntygType(utkast.getIntygsTyp()); entry.setIntygTypeVersion(utkast.getIntygTypeVersion()); entry.setSource(IntygSource.WC); entry.setUpdatedSignedBy(resolvedSignedBy(utkast)); entry.setUpdatedSignedById(resolvedSignedById(utkast)); entry.setLastUpdatedSigned(utkast.getSenastSparadDatum()); entry.setPatientId(utkast.getPatientPersonnummer()); entry.setVidarebefordrad(utkast.getVidarebefordrad()); entry.setStatus(resolveStatus(utkast)); entry.setVersion(utkast.getVersion()); entry.setVardenhetId(utkast.getEnhetsId()); entry.setVardgivarId(utkast.getVardgivarId()); entry.setTestIntyg(utkast.isTestIntyg()); return entry; }
IntygDraftsConverter { public static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast) { ListIntygEntry entry = new ListIntygEntry(); entry.setIntygId(utkast.getIntygsId()); entry.setIntygType(utkast.getIntygsTyp()); entry.setIntygTypeVersion(utkast.getIntygTypeVersion()); entry.setSource(IntygSource.WC); entry.setUpdatedSignedBy(resolvedSignedBy(utkast)); entry.setUpdatedSignedById(resolvedSignedById(utkast)); entry.setLastUpdatedSigned(utkast.getSenastSparadDatum()); entry.setPatientId(utkast.getPatientPersonnummer()); entry.setVidarebefordrad(utkast.getVidarebefordrad()); entry.setStatus(resolveStatus(utkast)); entry.setVersion(utkast.getVersion()); entry.setVardenhetId(utkast.getEnhetsId()); entry.setVardgivarId(utkast.getVardgivarId()); entry.setTestIntyg(utkast.isTestIntyg()); return entry; } }
IntygDraftsConverter { public static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast) { ListIntygEntry entry = new ListIntygEntry(); entry.setIntygId(utkast.getIntygsId()); entry.setIntygType(utkast.getIntygsTyp()); entry.setIntygTypeVersion(utkast.getIntygTypeVersion()); entry.setSource(IntygSource.WC); entry.setUpdatedSignedBy(resolvedSignedBy(utkast)); entry.setUpdatedSignedById(resolvedSignedById(utkast)); entry.setLastUpdatedSigned(utkast.getSenastSparadDatum()); entry.setPatientId(utkast.getPatientPersonnummer()); entry.setVidarebefordrad(utkast.getVidarebefordrad()); entry.setStatus(resolveStatus(utkast)); entry.setVersion(utkast.getVersion()); entry.setVardenhetId(utkast.getEnhetsId()); entry.setVardgivarId(utkast.getVardgivarId()); entry.setTestIntyg(utkast.isTestIntyg()); return entry; }  }
IntygDraftsConverter { public static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast) { ListIntygEntry entry = new ListIntygEntry(); entry.setIntygId(utkast.getIntygsId()); entry.setIntygType(utkast.getIntygsTyp()); entry.setIntygTypeVersion(utkast.getIntygTypeVersion()); entry.setSource(IntygSource.WC); entry.setUpdatedSignedBy(resolvedSignedBy(utkast)); entry.setUpdatedSignedById(resolvedSignedById(utkast)); entry.setLastUpdatedSigned(utkast.getSenastSparadDatum()); entry.setPatientId(utkast.getPatientPersonnummer()); entry.setVidarebefordrad(utkast.getVidarebefordrad()); entry.setStatus(resolveStatus(utkast)); entry.setVersion(utkast.getVersion()); entry.setVardenhetId(utkast.getEnhetsId()); entry.setVardgivarId(utkast.getVardgivarId()); entry.setTestIntyg(utkast.isTestIntyg()); return entry; }  static List<ListIntygEntry> merge(List<ListIntygEntry> intygList, List<Utkast> utkastList); static List<ListIntygEntry> convertUtkastsToListIntygEntries(List<Utkast> utkastList); static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast); static CertificateState findLatestStatus(List<IntygsStatus> intygStatuses); static String resolveStatus(Utkast draft); List<ListIntygEntry> convertIntygToListIntygEntries(List<Intyg> intygList, List<ListIntygEntry> webcertIntyg); }
IntygDraftsConverter { public static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast) { ListIntygEntry entry = new ListIntygEntry(); entry.setIntygId(utkast.getIntygsId()); entry.setIntygType(utkast.getIntygsTyp()); entry.setIntygTypeVersion(utkast.getIntygTypeVersion()); entry.setSource(IntygSource.WC); entry.setUpdatedSignedBy(resolvedSignedBy(utkast)); entry.setUpdatedSignedById(resolvedSignedById(utkast)); entry.setLastUpdatedSigned(utkast.getSenastSparadDatum()); entry.setPatientId(utkast.getPatientPersonnummer()); entry.setVidarebefordrad(utkast.getVidarebefordrad()); entry.setStatus(resolveStatus(utkast)); entry.setVersion(utkast.getVersion()); entry.setVardenhetId(utkast.getEnhetsId()); entry.setVardgivarId(utkast.getVardgivarId()); entry.setTestIntyg(utkast.isTestIntyg()); return entry; }  static List<ListIntygEntry> merge(List<ListIntygEntry> intygList, List<Utkast> utkastList); static List<ListIntygEntry> convertUtkastsToListIntygEntries(List<Utkast> utkastList); static ListIntygEntry convertUtkastToListIntygEntry(Utkast utkast); static CertificateState findLatestStatus(List<IntygsStatus> intygStatuses); static String resolveStatus(Utkast draft); List<ListIntygEntry> convertIntygToListIntygEntries(List<Intyg> intygList, List<ListIntygEntry> webcertIntyg);  }