diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/codes/CountryCodedValueFinder.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/codes/CountryCodedValueFinder.java index 629662ddbd..f9a908cfea 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/codes/CountryCodedValueFinder.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/codes/CountryCodedValueFinder.java @@ -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; @@ -21,14 +23,23 @@ class CountryCodedValueFinder { } Collection 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 result = new ArrayList<>(); + + result.add(new CodedValue("840", "United States")); + + List 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) { diff --git a/apps/modernization-ui/src/apps/patient/data/address/entry.ts b/apps/modernization-ui/src/apps/patient/data/address/entry.ts index 84b83a65f0..1b958eee67 100644 --- a/apps/modernization-ui/src/apps/patient/data/address/entry.ts +++ b/apps/modernization-ui/src/apps/patient/data/address/entry.ts @@ -28,7 +28,10 @@ const initial = (asOf: string = today()): Partial => ({ state: undefined, zipcode: '', county: undefined, - country: undefined, + country: { + value: '840', + name: 'United States' + }, censusTract: '', comment: '' });