Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cnft1 3377 UI new patient extended default value and first option for country should be united states of america #2128

Merged
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package gov.cdc.nbs.codes;

import java.util.ArrayList;
import java.util.List;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.Order;
import com.querydsl.core.types.OrderSpecifier;
Expand All @@ -21,14 +23,23 @@ class CountryCodedValueFinder {
}

Collection<CodedValue> all() {
return this.factory.select(
values.id,
values.codeDescTxt).from(values)
.orderBy(new OrderSpecifier<>(Order.ASC, values.codeDescTxt))
.fetch()
.stream()
.map(this::map)
.toList();
List<CodedValue> result = new ArrayList<>();

result.add(new CodedValue("840", "United States"));

List<CodedValue> fetchedValues = this.factory.select(
values.id,
values.codeDescTxt)
.from(values)
.where(values.codeDescTxt.ne("United States"))
.orderBy(new OrderSpecifier<>(Order.ASC, values.codeDescTxt))
.fetch()
.stream()
.map(this::map)
.toList();

result.addAll(fetchedValues);
return result;
}

private CodedValue map(final Tuple tuple) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const initial = (asOf: string = today()): Partial<AddressEntry> => ({
state: undefined,
zipcode: '',
county: undefined,
country: undefined,
country: {
value: '840',
name: 'United States'
},
censusTract: '',
comment: ''
});
Expand Down
Loading