Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
1 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
/**
*
*/
package gov.va.med.ewv.util;
import static gov.va.med.ewv.util.EwvNullsLastSortedList.getEwvServiceLinesList;
import static gov.va.med.ewv.util.EwvNullsLastSortedList.getSortedList;
import static gov.va.med.ewv.util.EwvSetToNullsLastList.getEwvSvcLineDmeList;
import static gov.va.med.ewv.util.NullsLastComparator.localDateUSA;
import static gov.va.med.ewv.util.NullsLastComparator.nullsLastBigDecimalComparator;
import static gov.va.med.ewv.util.NullsLastComparator.nullsLastLocalDateStringComparator;
import static gov.va.med.ewv.util.NullsLastComparator.nullsLastStringComparator;
//import static gov.va.med.ewv.util.SetToSortedList.toSortedList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import gov.va.med.domain.ewv.EwvAmbulanceInfo5010;
import gov.va.med.domain.ewv.EwvClaimOhis;
import gov.va.med.domain.ewv.EwvClaims;
import gov.va.med.domain.ewv.EwvServiceLineOhiAdjtmts;
import gov.va.med.domain.ewv.EwvServiceLineOhis;
import gov.va.med.domain.ewv.EwvServiceLines;
import gov.va.med.domain.ewv.EwvServiceLinesDrugs;
import gov.va.med.domain.ewv.EwvSlProvider;
import gov.va.med.domain.ewv.EwvSvcLineDme;
import gov.va.med.domain.ewv.EwvSvcLineTeeth;
/**
* @author
DNS
*
*/
public class EwvNullsLastSortedListTest {
// sample class containing Set<> for testing toSortedList
static List<Integer> integerList(int ...iArr)
{
return IntStream.of(iArr)
.boxed()
.collect(Collectors.toList());
}
static Set<Integer> integerSet(int ...iArr)
{
return IntStream.of(iArr)
.boxed()
.collect(Collectors.toSet());
}
class HasIntegerSet {
Set<Integer> iSet;
Set<Integer> getISet() { return iSet; }
HasIntegerSet(int ...iArr)
{
this.iSet = integerSet(iArr);
}
}
static int[] iArr = {3,1,4,1,5,9,2,6,5,3,5,8,9}; // Very specific, do not change
static List<Integer> iDist1 = IntStream.of(iArr)
.distinct() // {3,1,4,5,9,2,6,8}
.sorted() // {1,2,3,4,5,6,8,9}
.boxed() // Integer({1,2,3,4,5,6,8,9})
.map((iv) -> { return iv.equals(1) ? null : iv; }) // convert Integer(1) to null (at beginning)
.collect(Collectors.toList()); // {null, Integer(2), Integer(3), Integer(4), Integer(5), Integer(6), Integer(8), Integer(9)}
static List<Integer> iDist9 = IntStream.of(iArr)
.distinct()
.sorted()
.boxed()
.map((iv) -> { return iv.equals(9) ? null : iv; }) // convert Integer(9) to null at end
.collect(Collectors.toList()); // {Integer(1), Integer(2), Integer(3), Integer(4), Integer(5), Integer(6), Integer(8), null}
static Set<Integer> iSet1 = IntStream.of(iArr)
.boxed()
.map((iv) -> { return iv.equals(1) ? null : iv; }) // convert Integer(1) to null
.collect(Collectors.toSet()); // You can put a null in a set
static Set<Integer> iSet9 = IntStream.of(iArr)
.boxed()
.map((iv) -> { return iv.equals(9) ? null : iv; }) // convert Integer(9) to null
.collect(Collectors.toSet());
static List<Integer> iList = IntStream.of(iArr)
.boxed().collect(Collectors.toList());
static Set<Integer> iSet = IntStream.of(iArr)
.boxed().collect(Collectors.toSet());
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvClaimOhisList(gov.va.med.domain.ewv.EwvClaims)}.
*/
public static <T, E> void testGetList_nulls(
Supplier<T> newT,
BiConsumer<T, Set<E>> setESet,
Function<T, List<E>> getEList
) {
// public static List<EwvClaimOhis> getEwvClaimOhisList(EwvClaims obj) {
// return sortedList(obj, EwvClaims::getEwvClaimOhises, EwvNullsLastComparator::compare);
// }
T obj = newT.get();
Set<E> emptySet = Collections.<E>emptySet();
List<E> emptyList = Collections.<E>emptyList();
// Set<E> set = null;
List<E> list = null;
// test null obj
list = getEList.apply(null);
assertEquals(list, emptyList);
// // test null setEwvServiceLineses
setESet.accept(obj, null);
list = getEList.apply(obj);
assertEquals(list, emptyList);
//
// // test empty setEwvServiceLineses
setESet.accept(obj, emptySet);
list = getEList.apply(obj);
assertEquals(list, emptyList);
}
public static <T, E> void testSet_GetList_LocalDateString_String_BigDecimal(
Supplier<T> newT,
BiConsumer<T, Set<E>> setESet,
Function<T, List<E>> getEList,
Supplier<E> newE,
BiConsumer<E, String> setE0,
BiConsumer<E, String> setE1,
BiConsumer<E, BigDecimal> setE2,
Stream<String> data,
Comparator<E> compE
) {
T obj = newT.get();
Set<E> testSet = new HashSet<E>();
List<E> list = null;
Set<E> data1Set = genDate_LocalDateString_String_BigDecimal(
newE,
setE0,
setE1,
setE2,
data
);
testSet.addAll(data1Set);
E it = null;
// Generate some data
// A Set is in "random" order so we probably don't have to shuffle the list
Set<E> binaryChoiceSet = new HashSet<E>();
for( String dd : "01|17".split("\\|")) {
for( String mm : "03|10".split("\\|")) {
for (String yyyy : "2003|2018".split("\\|")) {
String date = String.join("/", mm, dd, yyyy);
for(String code : "PC|CP".split("\\|")) {
for(String ln : "3|7".split("\\|")) {
long lineNo = Long.parseLong(ln);
it = newE.get();
setE0.accept(it,date);
setE1.accept(it,code);
setE2.accept(it,new BigDecimal(lineNo * 0.1));
binaryChoiceSet.add(it);
}
}
}
}
}
testSet.addAll(binaryChoiceSet);
// Set the test case
setESet.accept(obj,testSet);
// Do the operation
list = getEList.apply(obj);
// Check the result
// We need to compare each element with the next element.
// But it's easier to compare with the previous element.
//
testList(list, (prev, curr) -> {return compE.compare(prev, curr) < 0;});
}
public static <T, E> void testSet_GetList_String_LocalDateString_BigDecimal(
Supplier<T> newT,
BiConsumer<T, Set<E>> setESet,
Function<T, List<E>> getEList,
Supplier<E> newE,
BiConsumer<E, String> setE0,
BiConsumer<E, String> setE1, // Local Date String
BiConsumer<E, BigDecimal> setE2,
Stream<String> data,
Comparator<E> compE
) {
T obj = newT.get();
Set<E> testSet = new HashSet<E>();
List<E> list = null;
Set<E> data1Set = genDate_LocalDateString_String_BigDecimal(
newE,
setE1, // swap to LocalDate
setE0, // use String
setE2,
data
);
testSet.addAll(data1Set);
E it = null;
// Generate some data
// A Set is in "random" order so we probably don't have to shuffle the list
Set<E> binaryChoiceSet = new HashSet<E>();
for(String code : "PC|CP".split("\\|")) {
for( String dd : "01|17".split("\\|")) {
for( String mm : "03|10".split("\\|")) {
for (String yyyy : "2003|2018".split("\\|")) {
String date = String.join("/", mm, dd, yyyy);
for(String ln : "3|7".split("\\|")) {
long lineNo = Long.parseLong(ln);
it = newE.get();
setE0.accept(it,code);
setE1.accept(it,date);
setE2.accept(it,new BigDecimal(lineNo * 0.1));
binaryChoiceSet.add(it);
}
}
}
}
}
testSet.addAll(binaryChoiceSet);
// Set the test case
setESet.accept(obj,testSet);
// Do the operation
list = getEList.apply(obj);
// Check the result
// We need to compare each element with the next element.
// But it's easier to compare with the previous element.
//
testList(list, (prev, curr) -> {return compE.compare(prev, curr) < 0;});
}
public static <T, E> void testSet_GetListSSS(
Supplier<T> newT,
BiConsumer<T, Set<E>> setESet,
Function<T, List<E>> getEList,
Supplier<E> newE,
BiConsumer<E, String> setE0,
BiConsumer<E, String> setE1,
BiConsumer<E, String> setE2,
Stream<String> data,
Comparator<E> compE
) {
T obj = newT.get();
Set<E> testSet = new HashSet<E>();
List<E> list = null;
Set<E> data1Set = genDataSSS(
newE,
setE0,
//setE1,
setE2,
data
);
testSet.addAll(data1Set);
E it = null;
// Generate some data
// A Set is in "random" order so we probably don't have to shuffle the list
Set<E> binaryChoiceSet = new HashSet<E>();
for( String dd : "01|17".split("\\|")) {
for( String mm : "03|10".split("\\|")) {
for (String yyyy : "2003|2018".split("\\|")) {
String date = String.join("/", mm, dd, yyyy);
for(String code : "PC|CP".split("\\|")) {
for(String ln : "3|7".split("\\|")) {
long lineNo = Long.parseLong(ln);
it = newE.get();
setE0.accept(it,date);
setE1.accept(it,code);
setE2.accept(it,ln);
binaryChoiceSet.add(it);
}
}
}
}
}
testSet.addAll(binaryChoiceSet);
// Set the test case
setESet.accept(obj,testSet);
// Do the operation
list = getEList.apply(obj);
// Check the result
// We need to compare each element with the next element.
// But it's easier to compare with the previous element.
//
testList(list, (prev, curr) -> {return compE.compare(prev, curr) < 0;});
}
public static <T, E> void testSet_GetList(
T obj,
Set<E> set,
BiConsumer<T, Set<E>> setESet,
Function<T, List<E>> getEList,
Comparator<E> compE
) {
setESet.accept(obj, set); // Set the test case
List<E> list = getEList.apply(obj); // Do the operation
testList(list, (a,b) -> { return compE.compare(a, b) < 1; }); // Check the result
}
public static <E> void testList(
List<E> list,
BiFunction<E, E, Boolean> testE
) {
// Check the result
// We need to compare each element with the next element.
// But it's easier to compare with the previous element.
//
boolean havePrev = false;
E prev = null;
for (E curr : list) {
if (havePrev) {
assertTrue( testE.apply(prev, curr) );
}
prev = curr; // remember for next time
havePrev = true; // remember that we remember
}
}
public static String[] data1 = {
// Make sure it is handled as a date: Choose dateStrings that sort differently than Strings
// Change #1, #2, #3
// Change #1, #2, #3 Year vs. Month Day
"10/29/2018|PC3|23",
"10/28/2018|PC1|23",
"10/27/2018|PC4|23",
"10/26/2018|PC3|32",
"10/25/2018|PC1|32",
"10/24/2018|PC4|32",
"10/29/2017|PC3|23",
"10/29/2017|PC1|23",
"10/29/2017|PC4|23",
"10/29/2017|PC3|32",
"10/29/2017|PC1|32",
"10/29/2017|PC4|32",
"10/29/1957|PC3|23",
"10/29/1957|PC1|23",
"10/29/1957|PC4|23",
"10/29/1957|PC3|32",
"10/29/1957|PC1|32",
"10/29/1957|PC4|32",
// Change #2, #3
"10/29/1|PC3|23",
"10/29/2018|PC1|23",
"10/29/2018|PC4|23",
"10/29/2018|PC3|32",
"10/29/2018|PC1|32",
"10/29/2018|PC4|32",
// Change #3
"10/29/2001|PC|33",
"10/29/2001|PC|31",
"10/29/2001|PC|34",
};
public static <T, E0, E1, E2> Set<T> genDataSSS(
Supplier<T> newT,
BiConsumer<T,String> setE0,
//BiConsumer<T, String> setE1,
BiConsumer<T, String> setE2,
Stream<String> data) {
Set<T> set = data
.map((row) -> {
String[] cols = row.split("\\|");
T obj = newT.get();
if (cols.length > 0) setE0.accept(obj, cols[0]);
//if (cols.length > 1) setE1.accept(obj, cols[1]);
if (cols.length > 2) setE2.accept(obj, cols[2]);
return obj; })
.collect(Collectors.toSet());
return set;
}
public static <T, E0, E1, E2> Set<T> genDate_LocalDateString_String_BigDecimal(
Supplier<T> newT,
BiConsumer<T,String> setE0,
BiConsumer<T, String> setE1,
BiConsumer<T, BigDecimal> setE2,
Stream<String> data) {
Set<T> set = data
.map((row) -> {
String[] cols = row.split("\\|");
T obj = newT.get();
if (cols.length > 0) setE0.accept(obj, cols[0]);
if (cols.length > 1) setE1.accept(obj, cols[1]);
if (cols.length > 2) setE2.accept(obj, new BigDecimal(Long.parseLong(cols[2]) * 0.1));
return obj; })
.collect(Collectors.toSet());
return set;
}
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getSortedList(java.lang.Object, java.util.function.Function, java.util.Comparator)}.
*/
@Test
public void testGetSortedList() {
// public static <T, R> List<R> sortedList(T obj, Function<T, Set<R>> getSet, Comparator<R> compare) {
// if (obj == null) {
// // We can hardly extract a set from a null object.
// // We could just return null, and let the caller handle it,
// // but we can return an empty list, which is easier to handle.
// return Collections.<R>emptyList();
// }
// Set<R> set = getSet.apply(obj);
// // Now, set could also be null, but toSortedList will also return an empty list in that case.
// return toSortedList(set, compare);
// }
List<Integer> iSort = null;
// Test that a null args are handled.
HasIntegerSet hasItNull = null;
assertNotEquals(iSort, Collections.<Integer>emptyList()); // iSort is null
iSort = EwvNullsLastSortedList.getSortedList(hasItNull, HasIntegerSet::getISet, Integer::compare);
assertEquals(iSort, Collections.<Integer>emptyList());
iSort = EwvNullsLastSortedList.getSortedList(hasItNull, HasIntegerSet::getISet, Integer::compare);
assertEquals(iSort, Collections.<Integer>emptyList());
iSort = EwvNullsLastSortedList.getSortedList(null, null, Integer::compare); // don't extract, don't compare
assertEquals(iSort, Collections.<Integer>emptyList());
iSort = EwvNullsLastSortedList.getSortedList(null, null, null); // how does it resolve?
assertEquals(iSort, Collections.<Integer>emptyList());
iSort = getSortedList(hasItNull, HasIntegerSet::getISet, Integer::compare);
assertEquals(iSort, Collections.<Integer>emptyList());
iSort = getSortedList(hasItNull, HasIntegerSet::getISet, Integer::compare);
assertEquals(iSort, Collections.<Integer>emptyList());
iSort = getSortedList(null, null, null); // how does it resolve?
assertEquals(iSort, Collections.<Integer>emptyList());
//
HasIntegerSet hasIt314 = new HasIntegerSet(3,1,4,1,5,9,2,6,5,3,5,8,9);
iSort = getSortedList(hasIt314, HasIntegerSet::getISet, Integer::compare); //
assertEquals(iSort, integerList(1,2,3,4,5,6,8,9));
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvServiceLinesList(gov.va.med.domain.ewv.EwvClaims)}.
*/
@Test
public void testGetEwvServiceLinesList() {
// .comparing(EwvServiceLines::getBeginDateOfService, nullsLastLocalDateStringComparator)
// .thenComparing(EwvServiceLines::getProcedureCode, nullsLastStringComparator)
// .thenComparing(EwvServiceLines::getLineNumber, Long::compare) // This might be all that is needed
testGetList_nulls(
EwvClaims::new,
EwvClaims::setEwvServiceLineses,
EwvNullsLastSortedList::getEwvServiceLinesList
);
EwvClaims obj = new EwvClaims();
Set<EwvServiceLines> eslTestSet = new HashSet<EwvServiceLines>();
List<EwvServiceLines> list = null;
Set<EwvServiceLines> data1Set = genDataSSS(
EwvServiceLines::new,
EwvServiceLines::setBeginDateOfService,
//EwvServiceLines::setProcedureCode,
(esl, str) -> { esl.setLineNumber(Long.parseLong(str)); },
Stream.of(data1)
);
eslTestSet.addAll(data1Set);
EwvServiceLines esl = null;
// Generate some data
// A Set is in "random" order so we probably don't have to shuffle the list
Set<EwvServiceLines> binaryChoiceSet = new HashSet<EwvServiceLines>();
for( String dd : "01|17".split("\\|")) {
for( String mm : "03|10".split("\\|")) {
for (String yyyy : "2003|2018".split("\\|")) {
String date = String.join("/", mm, dd, yyyy);
for(String code : "PC|CP".split("\\|")) {
for(String ln : "3|7".split("\\|")) {
long lineNo = Long.parseLong(ln);
esl = new EwvServiceLines();
esl.setBeginDateOfService(date);
//esl.setProcedureCode(code);
esl.setLineNumber(lineNo);
binaryChoiceSet.add(esl);
}
}
}
}
}
eslTestSet.addAll(binaryChoiceSet);
// Set the test case
obj.setEwvServiceLineses(eslTestSet);
// Do the operation
list = getEwvServiceLinesList(obj);
// Check the result
// We need to compare each element with the next element.
// But it's easier to compare with the previous element.
//
Comparator<EwvServiceLines> compEwvServiceLines = Comparator.nullsLast(Comparator
.comparing(EwvServiceLines::getBeginDateOfService, nullsLastLocalDateStringComparator)
//.thenComparing(EwvServiceLines::getProcedureCode, nullsLastStringComparator)
.thenComparing(EwvServiceLines::getLineNumber, Long::compare)
);
//testList(list, (prev, curr) -> {return compEwvServiceLines.compare(prev, curr) < 0;});
// But what if Comparators are broken, misapplied? Do it in the raw:
BiFunction<EwvServiceLines, EwvServiceLines, Boolean> cmpEwvServiceLines =
(cmp0, cmp1) -> {
String d0 = cmp0.getBeginDateOfService();
String d1 = cmp1.getBeginDateOfService();
int ds = nullsLastLocalDateStringComparator.compare(d0, d1); // d sign
if (ds == 0) {
/*String p0 = cmp0.getProcedureCode();
String p1 = cmp1.getProcedureCode();
int ps = nullsLastStringComparator.compare(p0, p1);
if (ps == 0) {*/
long l0 = cmp0.getLineNumber();
long l1 = cmp1.getLineNumber();
int ls = Long.compare(l0, l1);
return ls < 1;
/*} else {
return ps < 1;
}*/
} else {
return ds < 1;
}
};
testList(list, cmpEwvServiceLines);
// But what if Comparators are broken, misapplied? Do it in the raw: Even breaking NullsLast down
BiFunction<EwvServiceLines, EwvServiceLines, Boolean> cmpNullsLastEwvServiceLines =
(cmp0, cmp1) -> {
String d0 = cmp0.getBeginDateOfService();
String d1 = cmp1.getBeginDateOfService();
LocalDate ld0 = localDateUSA(d0);
LocalDate ld1 = localDateUSA(d1);
int ds = d0 == null
? // null0
(d1 == null
? 0 // null0 == null1
: 1 // null0 > any1
)
: // any0
(d1 == null
? -1 // any0 < null0
// : localDateUSA(d0).compareTo(localDateUSA(d1))); // this gets NPE because localDateUSA("xx") => null
: (ld0 == null
? (ld1 == null
? 0 // both null
: 1 // Null > any
)
: (ld1 == null ? -1 // nullsLast
: ld0.compareTo(ld1))
)
);
// This is why we use nullsLast()
if (ds == 0) {
/*String p0 = cmp0.getProcedureCode();
String p1 = cmp1.getProcedureCode();
int ps = p0 == null ? (p1 == null ? 0 : 1) // make nullsLast ? 0 {null == null} : 1 {null > anyOther}
: (p1 == null ? -1 : p0.compareTo(p1));
if (ps == 0) {*/
// primitive long cannot be null
long l0 = cmp0.getLineNumber();
long l1 = cmp1.getLineNumber();
int ls = Long.compare(l0, l1);
return ls < 1;
/*} else {
return ps < 1;
}*/
} else {
return ds < 1;
}
};
testList(list, cmpNullsLastEwvServiceLines);
// Some items should be null, to fully check. But we already test that in SetToSortedList
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvClaimOhisList(gov.va.med.domain.ewv.EwvClaims)}.
*/
@Test
public void testGetEwvClaimOhisList() {
// public static List<EwvClaimOhis> getEwvClaimOhisList(EwvClaims obj) {
// return sortedList(obj, EwvClaims::getEwvClaimOhises, EwvNullsLastComparator::compare);
// }
// Comparator.nullsLast(Comparator
// .comparing(EwvClaimOhis::getPaymentSequenceIndicator, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getClaimAdjustmentDate, nullsLastLocalDateStringComparator)
// .thenComparing(EwvClaimOhis::getOhiPayerId, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getSubscriberPayerId, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOtherPayerName, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOhiGroupName, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getFilingIndicator, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getBenefitsAssignmentIndicator, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInsuranceType, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobSubmittedCharges, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobTotalAllowedAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobApprovedAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobTotalNoncoveredAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobPayerPaidAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobTotalDeniedAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobTotalMedicarePaidAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobPatientPaidAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobMedicarePaidAmt100, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobPatientResponsibility, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobMedicarePaidAmt80, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobMedicareATrustFund, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getCobMedicareBTrustFund, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpCoveredDays, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpLifetimeReserveDays, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpLifetimePsychiatricDays, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpClaimDrgAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpClaimDisproporShare, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpMspPassThroughAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpClaimPpsCapitalAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsCapitalFspDrgAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsCapitalHspDrgAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsCapitalDshDrgAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpOldCapitalAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsCapitalImeAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsOperHospSpecDrgAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsOperFedSpecDrgAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsCapitalOutlrAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpClaimIndirectTeachAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpNonpayableProfComponent, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpPpsCapitalExceptionAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpCostReportDayCount, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode1, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc1, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode2, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc2, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode3, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc3, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode4, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc4, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode5, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc5, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptReimbursementRate, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptEsrdPaidAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptClaimHcpcsPayableAmt, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptNonpayableProfComponent, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode1, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc1, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode2, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc2, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode3, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc3, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode4, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc4, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode5, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc5, nullsLastStringComparator)
//// .thenComparing(EwvClaimOhis::getewvClaims, nullsLastEwvClaimsComparator)
//// .thenComparing(EwvClaimOhis::getEwvClaimLevelAdjustmentses, nullsLastEwvClaimLevelAdjustmentsComparator)
// .thenComparing(EwvClaimOhis::getGuid, nullsLastBigDecimalComparator)
testGetList_nulls(
EwvClaims::new,
EwvClaims::setEwvClaimOhises,
EwvNullsLastSortedList::getEwvClaimOhisList
);
// Some items should be null, to fully check. But we already test that in SetToSortedList
testSet_GetList_String_LocalDateString_BigDecimal(
EwvClaims::new,
EwvClaims::setEwvClaimOhises,
EwvNullsLastSortedList::getEwvClaimOhisList,
EwvClaimOhis::new,
EwvClaimOhis::setPaymentSequenceIndicator,
EwvClaimOhis::setClaimAdjustmentDate,
EwvClaimOhis::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvClaimOhis::getPaymentSequenceIndicator, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getClaimAdjustmentDate, nullsLastLocalDateStringComparator)
.thenComparing(EwvClaimOhis::getOhiPayerId, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getSubscriberPayerId, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOtherPayerName, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOhiGroupName, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getFilingIndicator, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getBenefitsAssignmentIndicator, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInsuranceType, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobSubmittedCharges, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobTotalAllowedAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobApprovedAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobTotalNoncoveredAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobPayerPaidAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobTotalDeniedAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobTotalMedicarePaidAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobPatientPaidAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobMedicarePaidAmt100, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobPatientResponsibility, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobMedicarePaidAmt80, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobMedicareATrustFund, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getCobMedicareBTrustFund, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpCoveredDays, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpLifetimeReserveDays, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpLifetimePsychiatricDays, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpClaimDrgAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpClaimDisproporShare, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpMspPassThroughAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpClaimPpsCapitalAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsCapitalFspDrgAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsCapitalHspDrgAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsCapitalDshDrgAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpOldCapitalAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsCapitalImeAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsOperHospSpecDrgAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsOperFedSpecDrgAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsCapitalOutlrAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpClaimIndirectTeachAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpNonpayableProfComponent, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpPpsCapitalExceptionAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpCostReportDayCount, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode1, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc1, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode2, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc2, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode3, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc3, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode4, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc4, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkCode5, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getInpRemittanceRemarkDesc5, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptReimbursementRate, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptEsrdPaidAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptClaimHcpcsPayableAmt, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptNonpayableProfComponent, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode1, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc1, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode2, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc2, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode3, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc3, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode4, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc4, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkCode5, nullsLastStringComparator)
.thenComparing(EwvClaimOhis::getOptRemittanceRemarkDesc5, nullsLastStringComparator)
// .thenComparing(EwvClaimOhis::getewvClaims, nullsLastEwvClaimsComparator)
// .thenComparing(EwvClaimOhis::getEwvClaimLevelAdjustmentses, nullsLastEwvClaimLevelAdjustmentsComparator)
.thenComparing(EwvClaimOhis::getGuid, nullsLastBigDecimalComparator)
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvSvcLineDmeList(gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Test
public void testGetEwvSvcLineDmeList() {
// public static final Comparator<EwvSvcLineDme> nullsLastEwvSvcLineDmeComparator =
// Comparator.nullsLast(Comparator
// .comparing(EwvSvcLineDme::getDmeLengthMedicalNecessity, nullsLastStringComparator)
// .thenComparing(EwvSvcLineDme::getDmeFrequency, nullsLastStringComparator)
// .thenComparing(EwvSvcLineDme::getDmeRentalAmt, nullsLastStringComparator)
// .thenComparing(EwvSvcLineDme::getDmePurchaseAmt, nullsLastStringComparator)
// .thenComparing(EwvSvcLineDme::getGuid, nullsLastBigDecimalComparator)
//// .thenComparing(EwvSvcLineDme::getEwvServiceLines; // parent back-link
// );
testGetList_nulls(
EwvServiceLines::new,
EwvServiceLines::setEwvSvcLineDmes,
EwvNullsLastSortedList::getEwvSvcLineDmeList
);
EwvServiceLines obj = new EwvServiceLines();
Set<EwvSvcLineDme> testSet = new HashSet<EwvSvcLineDme>();
List<EwvSvcLineDme> list = null;
Set<EwvSvcLineDme> data1Set = genDate_LocalDateString_String_BigDecimal(
EwvSvcLineDme::new,
EwvSvcLineDme::setDmeLengthMedicalNecessity,
EwvSvcLineDme::setDmeFrequency,
EwvSvcLineDme::setGuid,
Stream.of(data1)
);
testSet.addAll(data1Set);
EwvSvcLineDme it = null;
// Generate some data
// A Set is in "random" order so we probably don't have to shuffle the list
Set<EwvSvcLineDme> binaryChoiceSet = new HashSet<EwvSvcLineDme>();
for( String dd : "01|17".split("\\|")) {
for( String mm : "03|10".split("\\|")) {
for (String yyyy : "2003|2018".split("\\|")) {
String date = String.join("/", mm, dd, yyyy);
for(String code : "PC|CP".split("\\|")) {
for(String ln : "3|7".split("\\|")) {
long lineNo = Long.parseLong(ln);
it = new EwvSvcLineDme();
it.setDmeLengthMedicalNecessity(date);
it.setDmeFrequency(code);
it.setGuid(new BigDecimal(lineNo * 0.1));
binaryChoiceSet.add(it);
}
}
}
}
}
testSet.addAll(binaryChoiceSet);
// Set the test case
obj.setEwvSvcLineDmes(testSet);
// Do the operation
list = getEwvSvcLineDmeList(obj);
// Check the result
// We need to compare each element with the next element.
// But it's easier to compare with the previous element.
//
Comparator<EwvSvcLineDme> compEwvServiceLines = Comparator.nullsLast(Comparator
.comparing(EwvSvcLineDme::getDmeLengthMedicalNecessity, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getDmeFrequency, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getDmeRentalAmt, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getDmePurchaseAmt, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getGuid, nullsLastBigDecimalComparator)
);
testList(list, (prev, curr) -> {return compEwvServiceLines.compare(prev, curr) < 0;});
// DO it again using generic function!
// LocalDate is still a string, so it's OK!
testSet_GetList_LocalDateString_String_BigDecimal(
EwvServiceLines::new,
EwvServiceLines::setEwvSvcLineDmes,
EwvNullsLastSortedList::getEwvSvcLineDmeList,
EwvSvcLineDme::new,
EwvSvcLineDme::setDmeLengthMedicalNecessity,
EwvSvcLineDme::setDmeFrequency,
EwvSvcLineDme::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvSvcLineDme::getDmeLengthMedicalNecessity, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getDmeFrequency, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getDmeRentalAmt, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getDmePurchaseAmt, nullsLastStringComparator)
.thenComparing(EwvSvcLineDme::getGuid, nullsLastBigDecimalComparator)
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvSlProviderList(gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Test
public void testGetEwvSlProviderList() {
testGetList_nulls(
EwvServiceLines::new,
EwvServiceLines::setEwvSlProviders,
EwvNullsLastSortedList::getEwvSlProviderList
);
testSet_GetList_LocalDateString_String_BigDecimal(
EwvServiceLines::new,
EwvServiceLines::setEwvSlProviders,
EwvNullsLastSortedList::getEwvSlProviderList,
EwvSlProvider::new,
EwvSlProvider::setProviderType,
EwvSlProvider::setProviderId,
EwvSlProvider::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvSlProvider::getProviderType, nullsLastStringComparator) // test this
.thenComparing(EwvSlProvider::getProviderId, nullsLastStringComparator) // test this
.thenComparing(EwvSlProvider::getProviderLname, nullsLastStringComparator) // skip...
.thenComparing(EwvSlProvider::getProviderFname, nullsLastStringComparator)
.thenComparing(EwvSlProvider::getProviderNpi5010, nullsLastStringComparator)
.thenComparing(EwvSlProvider::getPostalCode5010, nullsLastStringComparator)
.thenComparing(EwvSlProvider::getProviderMname, nullsLastStringComparator)
.thenComparing(EwvSlProvider::getTaxonomyCode, nullsLastStringComparator)
.thenComparing(EwvSlProvider::getGuid, nullsLastBigDecimalComparator) // test this
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvServiceLineOhisList(gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Test
public void testGetEwvServiceLineOhisList() {
testGetList_nulls(
EwvServiceLines::new,
EwvServiceLines::setEwvServiceLineOhises,
EwvNullsLastSortedList::getEwvServiceLineOhisList
);
testSet_GetList_LocalDateString_String_BigDecimal(
EwvServiceLines::new,
EwvServiceLines::setEwvServiceLineOhises,
EwvNullsLastSortedList::getEwvServiceLineOhisList,
EwvServiceLineOhis::new,
EwvServiceLineOhis::setOhiAdjudicatedDate,
EwvServiceLineOhis::setProcedureCode,
EwvServiceLineOhis::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvServiceLineOhis::getOhiAdjudicatedDate, NullsLastComparator.nullsLastLocalDateStringComparator)
.thenComparing(EwvServiceLineOhis::getProcedureCode, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getRevenueCode, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getAdjudicated, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getModifier1, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getModifier2, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getModifier3, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getModifier4, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getPayerId, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhis::getGuid, nullsLastBigDecimalComparator)
// .thenComparing(EwvServiceLineOhis::getEwvServiceLines, EwvServiceLines::compareTo) // No!
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvSvcLineTeethList(gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Test
public void testGetEwvSvcLineTeethList() {
testGetList_nulls(
EwvServiceLines::new,
EwvServiceLines::setEwvSvcLineTeeths,
EwvNullsLastSortedList::getEwvSvcLineTeethList
);
testSet_GetList_LocalDateString_String_BigDecimal(
EwvServiceLines::new,
EwvServiceLines::setEwvSvcLineTeeths,
EwvNullsLastSortedList::getEwvSvcLineTeethList,
EwvSvcLineTeeth::new,
EwvSvcLineTeeth::setToothNumber,
EwvSvcLineTeeth::setSurface1,
EwvSvcLineTeeth::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvSvcLineTeeth::getToothNumber, nullsLastStringComparator)
.thenComparing(EwvSvcLineTeeth::getSurface1, nullsLastStringComparator)
.thenComparing(EwvSvcLineTeeth::getSurface2, nullsLastStringComparator)
.thenComparing(EwvSvcLineTeeth::getSurface3, nullsLastStringComparator)
.thenComparing(EwvSvcLineTeeth::getSurface4, nullsLastStringComparator)
.thenComparing(EwvSvcLineTeeth::getSurface5, nullsLastStringComparator)
.thenComparing(EwvSvcLineTeeth::getGuid, nullsLastBigDecimalComparator)
// .thenComparing(EwvSvcLineTeeth::getEwvServiceLines; // parent back-link
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvAmbulanceInfo5010List(gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Test
public void testGetEwvAmbulanceInfo5010List() {
testGetList_nulls(
EwvServiceLines::new,
EwvServiceLines::setEwvAmbulanceInfo5010s,
EwvNullsLastSortedList::getEwvAmbulanceInfo5010List
);
testSet_GetList_LocalDateString_String_BigDecimal(
EwvServiceLines::new,
EwvServiceLines::setEwvAmbulanceInfo5010s,
EwvNullsLastSortedList::getEwvAmbulanceInfo5010List,
EwvAmbulanceInfo5010::new,
EwvAmbulanceInfo5010::setPickupAddressLine1,
EwvAmbulanceInfo5010::setPickupAddressLine2,
EwvAmbulanceInfo5010::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvAmbulanceInfo5010::getPickupAddressLine1, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getPickupAddressLine2, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getPickupCity, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getPickupState, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getPickupZip, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getDropoffAddressLine1, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getDropoffAddressLine2, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getDropoffCity, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getDropoffState, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getDropoffZip, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getTransportReasonCode, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getTransportDistance, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getRoundTripPurpose, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getStretcherPurpose, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getCertIndicator1, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode11, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode12, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode13, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode14, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode15, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getCertIndicator2, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode21, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode22, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode23, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode24, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode25, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getCertIndicator3, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode31, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode32, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode33, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode34, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getConditionCode35, nullsLastStringComparator)
.thenComparing(EwvAmbulanceInfo5010::getGuid, nullsLastBigDecimalComparator)
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvServiceLinesDrugsList(gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Ignore
@Test
public void testGetEwvServiceLinesDrugsList() {
testGetList_nulls(
EwvServiceLines::new,
EwvServiceLines::setEwvServiceLinesDrugses,
EwvNullsLastSortedList::getEwvServiceLinesDrugsList
);
testSet_GetListSSS(
EwvServiceLines::new,
EwvServiceLines::setEwvServiceLinesDrugses,
EwvNullsLastSortedList::getEwvServiceLinesDrugsList,
EwvServiceLinesDrugs::new,
EwvServiceLinesDrugs::setDrugRx,
EwvServiceLinesDrugs::setDrugRxNdcCode,
EwvServiceLinesDrugs::setDrugRxCategory5010,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvServiceLinesDrugs::getDrugRx, nullsLastStringComparator)
.thenComparing(EwvServiceLinesDrugs::getDrugRxNdcCode, nullsLastStringComparator)
.thenComparing(EwvServiceLinesDrugs::getDrugRxQuantity, nullsLastStringComparator)
.thenComparing(EwvServiceLinesDrugs::getDrugRxType, nullsLastStringComparator)
.thenComparing(EwvServiceLinesDrugs::getDrugRxCharge, nullsLastStringComparator)
.thenComparing(EwvServiceLinesDrugs::getDrugRxCategory5010, nullsLastStringComparator)
// .thenComparing(EwvServiceLinesDrugs::getEwvServiceLines; // parent back-link
)
);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastSortedList#getEwvServiceLineOhiAdjtmtsList(gov.va.med.domain.ewv.EwvServiceLineOhis)}.
*/
@Test
public void testGetEwvServiceLineOhiAdjtmtsList() {
testGetList_nulls(
EwvServiceLineOhis::new,
EwvServiceLineOhis::setEwvServiceLineOhiAdjtmtses,
EwvNullsLastSortedList::getEwvServiceLineOhiAdjtmtsList
);
testSet_GetList_LocalDateString_String_BigDecimal(
EwvServiceLineOhis::new,
EwvServiceLineOhis::setEwvServiceLineOhiAdjtmtses,
EwvNullsLastSortedList::getEwvServiceLineOhiAdjtmtsList,
EwvServiceLineOhiAdjtmts::new,
EwvServiceLineOhiAdjtmts::setPrimaryPayerId,
EwvServiceLineOhiAdjtmts::setSvcLineAdjustmtReasonCode,
EwvServiceLineOhiAdjtmts::setGuid,
Stream.of(data1),
Comparator.nullsLast(Comparator
.comparing(EwvServiceLineOhiAdjtmts::getPrimaryPayerId, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getSvcLineAdjustmtReasonCode, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getDescription, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getQuantity, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getCoAmt, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getOaAmt, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getPiAmt, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getPrAmt, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getPrAmt, nullsLastStringComparator)
.thenComparing(EwvServiceLineOhiAdjtmts::getGuid, nullsLastBigDecimalComparator)
)
);
}
}