diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/ElasticsearchPatientSearcher.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/ElasticsearchPatientSearcher.java index 22e63248b1..6aab183c12 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/ElasticsearchPatientSearcher.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/ElasticsearchPatientSearcher.java @@ -31,8 +31,7 @@ class ElasticsearchPatientSearcher implements SearchResolver search( final PatientFilter criteria, - final Pageable pageable - ) { + final Pageable pageable) { Query filter = filterResolver.resolve(criteria); Query query = queryResolver.resolve(criteria); @@ -60,8 +58,7 @@ public SearchResult search( .sort(sorting) .from((int) pageable.getOffset()) .size(pageable.getPageSize()), - SearchablePatient.class - ); + SearchablePatient.class); HitsMetadata hits = response.hits(); @@ -78,8 +75,7 @@ public SearchResult search( private SearchResult paged( final HitsMetadata hits, - final Pageable pageable - ) { + final Pageable pageable) { List ids = hits.hits() .stream() .map(hit -> Long.parseLong(hit.id())) @@ -93,7 +89,6 @@ private SearchResult paged( return resultResolver.resolve( results, pageable, - hits.total().value() - ); + hits.total().value()); } } diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientDemographicQueryResolver.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientDemographicQueryResolver.java new file mode 100644 index 0000000000..5e44482cbc --- /dev/null +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientDemographicQueryResolver.java @@ -0,0 +1,414 @@ +package gov.cdc.nbs.patient.search; + +import java.time.LocalDate; +import java.util.Optional; +import java.util.stream.Stream; +import org.apache.commons.codec.language.Soundex; +import org.springframework.stereotype.Component; +import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.ChildScoreMode; +import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.NestedQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.Operator; +import co.elastic.clients.elasticsearch._types.query_dsl.PrefixQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant; +import co.elastic.clients.elasticsearch._types.query_dsl.RangeQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.TermQuery; +import co.elastic.clients.json.JsonData; +import gov.cdc.nbs.patient.identifier.PatientLocalIdentifierResolver; +import gov.cdc.nbs.search.AdjustStrings; +import gov.cdc.nbs.search.WildCards; +import gov.cdc.nbs.search.criteria.date.DateCriteria; +import gov.cdc.nbs.search.criteria.date.DateCriteria.Between; +import gov.cdc.nbs.search.criteria.date.DateCriteria.Equals; +import gov.cdc.nbs.time.FlexibleInstantConverter; + +@Component +class PatientDemographicQueryResolver { + private static final String NAMES = "name"; + private static final String PHONES = "phone"; + private static final String EMAILS = "email"; + private static final String IDENTIFICATIONS = "entity_id"; + private static final String BIRTHDAY = "birth_time"; + private static final String ADDRESSES = "address"; + private final PatientSearchSettings settings; + private final PatientLocalIdentifierResolver resolver; + private final Soundex soundex; + + PatientDemographicQueryResolver( + final PatientSearchSettings settings, + final PatientLocalIdentifierResolver resolver) { + this.settings = settings; + this.resolver = resolver; + this.soundex = new Soundex(); + } + + Stream resolve(final PatientFilter criteria) { + return Stream.of( + applyPatientIdentifierCriteria(criteria), + applyFirstNameCriteria(criteria), + applyLastNameCriteria(criteria), + applyPhoneNumberCriteria(criteria), + applyEmailCriteria(criteria), + applyIdentificationCriteria(criteria), + applyDateOfBirthCriteria(criteria), + applyStreetAddressCriteria(criteria), + applyCityCriteria(criteria), + applyDateOfBirthHighRangeCriteria(criteria), + applyDateOfBirthLowRangeCriteria(criteria), + applyZipcodeCriteria(criteria)).flatMap(Optional::stream) + .map(QueryVariant::_toQuery); + } + + private Optional applyPatientIdentifierCriteria(final PatientFilter criteria) { + if (criteria.getId() != null) { + String shortOrLongIdStripped = criteria.getId().strip(); + + if (shortOrLongIdStripped.isEmpty()) { + return Optional.empty(); + } + + if (Character.isDigit(shortOrLongIdStripped.charAt(0))) { + // This may be a short id, resolve the local id and then search for it + try { + long shortId = Long.parseLong(shortOrLongIdStripped); + + String localId = resolver.resolve(shortId); + + return applyLocalId(localId); + + } catch (NumberFormatException exception) { + // skip these criteria. it's not a short id or long id + } + } else { + return applyLocalId(shortOrLongIdStripped); + } + } + + return Optional.empty(); + } + + private Optional applyLocalId(final String local) { + return Optional.of( + TermQuery.of( + query -> query.field("local_id") + .value(local))); + } + + private Optional applyFirstNameCriteria(final PatientFilter criteria) { + String name = criteria.getFirstName(); + + if (name != null && !name.isBlank()) { + + String encoded; + if (criteria.isDisableSoundex()) { + encoded = ""; + } else { + encoded = soundex.encode(name.trim()); + } + + return Optional.of( + BoolQuery.of( + bool -> bool.should( + should -> should.nested( + nested -> nested.path(NAMES) + .scoreMode(ChildScoreMode.Max) + .query( + query -> query.bool( + legal -> legal.filter( + filter -> filter.term( + term -> term.field("name.nm_use_cd.keyword") + .value("L"))) + .must( + primary -> primary.match( + match -> match + .field("name.firstNm") + .query(name) + .boost(settings.first().primary()) + + )))))).should( + should -> should.nested( + nested -> nested.path(NAMES) + .scoreMode(ChildScoreMode.Avg) + .query( + nonPrimary -> nonPrimary.simpleQueryString( + queryString -> queryString + .fields("name.firstNm") + .query(WildCards.startsWith(name)) + .boost(settings.first().nonPrimary()))))) + .should( + should -> should.nested( + nested -> nested.path(NAMES) + .scoreMode(ChildScoreMode.Avg) + .boost(settings.first().soundex()) + .query( + query -> query.term( + term -> term + .field("name.firstNmSndx.keyword") + .value(encoded))))))); + } + return Optional.empty(); + } + + private Optional applyLastNameCriteria(final PatientFilter criteria) { + String name = AdjustStrings.withoutHyphens(criteria.getLastName()); + + if (name != null && !name.isBlank()) { + String encoded; + if (criteria.isDisableSoundex()) { + encoded = ""; + } else { + encoded = soundex.encode(name.trim()); + } + + return Optional.of( + BoolQuery.of( + bool -> bool.should( + should -> should.nested( + nested -> nested.path(NAMES) + .scoreMode(ChildScoreMode.Max) + .query( + query -> query.bool( + legal -> legal.filter( + filter -> filter.term( + term -> term.field("name.nm_use_cd.keyword") + .value("L"))) + .must( + primary -> primary.match( + match -> match + .field("name.lastNm") + .query(name) + .boost(settings.first().primary()))))))) + .should( + should -> should.nested( + nested -> nested.path(NAMES) + .scoreMode(ChildScoreMode.Avg) + .query( + query -> query.simpleQueryString( + nonPrimary -> nonPrimary + .fields("name.lastNm") + .query(WildCards.startsWith(name)) + .boost(settings.first().nonPrimary()))))) + .should( + should -> should.nested( + nested -> nested.path(NAMES) + .scoreMode(ChildScoreMode.Avg) + .boost(settings.first().soundex()) + .query( + query -> query.term( + term -> term + .field("name.lastNmSndx.keyword") + .value(encoded))))))); + } + return Optional.empty(); + } + + private Optional applyPhoneNumberCriteria(final PatientFilter criteria) { + + String number = AdjustStrings.withoutSpecialCharacters(criteria.getPhoneNumber()); + + if (number != null && !number.isEmpty()) { + + return Optional.of( + NestedQuery.of( + nested -> nested.path(PHONES) + .scoreMode(ChildScoreMode.Avg) + .query( + query -> query.wildcard( + wildcard -> wildcard.field("phone.telephoneNbr") + .value(WildCards.contains(number)))))); + + } + + return Optional.empty(); + } + + private Optional applyEmailCriteria(final PatientFilter criteria) { + + String email = criteria.getEmail(); + if (email != null && !email.isEmpty()) { + + return Optional.of( + NestedQuery.of( + nested -> nested.path(EMAILS) + .scoreMode(ChildScoreMode.Avg) + .query( + query -> query.simpleQueryString( + queryString -> queryString.fields("email.emailAddress") + .defaultOperator(Operator.And) + .query(email))))); + } + + return Optional.empty(); + } + + private Optional applyIdentificationCriteria(final PatientFilter criteria) { + + PatientFilter.Identification identification = criteria.getIdentification(); + + String type = identification.getIdentificationType(); + String value = AdjustStrings.withoutSpecialCharacters(identification.getIdentificationNumber()); + + if (type != null && (value != null && !value.isEmpty())) { + return Optional.of( + NestedQuery.of( + nested -> nested.path(IDENTIFICATIONS) + .scoreMode(ChildScoreMode.Avg) + .query( + query -> query.bool( + bool -> bool.filter( + filter -> filter.term( + term -> term.field("entity_id.typeCd.keyword") + .value(type))) + .must( + must -> must.prefix( + prefix -> prefix.field("entity_id.rootExtensionTxt").caseInsensitive(true) + .value(value))))))); + } + return Optional.empty(); + } + + private Optional applyDateOfBirthCriteria(final PatientFilter criteria) { + + LocalDate dateOfBirth = criteria.getDateOfBirth(); + + if (dateOfBirth != null) { + String operator = resolveDateOperator(criteria.getDateOfBirthOperator()); + String value = FlexibleInstantConverter.toString(dateOfBirth); + + return switch (operator) { + case "before" -> Optional.of( + RangeQuery.of( + range -> range.field(BIRTHDAY) + .lt(JsonData.of(value)))); + case "after" -> Optional.of( + RangeQuery.of( + range -> range.field(BIRTHDAY) + .gt(JsonData.of(value)))); + default -> Optional.of( + MatchQuery.of( + match -> match.field(BIRTHDAY) + .query(value))); + }; + } + + DateCriteria dateCriteria = criteria.getBornOn(); + if (dateCriteria != null && dateCriteria.equals() != null && dateCriteria.equals().isCompleteDate()) { + Equals equals = dateCriteria.equals(); + String value = FlexibleInstantConverter.toString(LocalDate.of(equals.year(), equals.month(), equals.day())); + return Optional.of( + MatchQuery.of( + match -> match.field(BIRTHDAY) + .query(value))); + + } + + return Optional.empty(); + } + + private Optional applyDateOfBirthLowRangeCriteria(final PatientFilter criteria) { + DateCriteria dateCriteria = criteria.getBornOn(); + if (dateCriteria == null) { + return Optional.empty(); + } + Between betweenDate = dateCriteria.between(); + if (betweenDate == null || betweenDate.from() == null) { + return Optional.empty(); + } + + + String value = FlexibleInstantConverter.toString(betweenDate.from()); + + return Optional.of( + RangeQuery.of( + range -> range.field(BIRTHDAY) + .gte(JsonData.of(value)))); + } + + private Optional applyDateOfBirthHighRangeCriteria(final PatientFilter criteria) { + DateCriteria dateCriteria = criteria.getBornOn(); + if (dateCriteria == null) { + return Optional.empty(); + } + Between betweenDate = dateCriteria.between(); + if (betweenDate == null || betweenDate.to() == null) { + return Optional.empty(); + } + + String value = FlexibleInstantConverter.toString(betweenDate.to()); + + return Optional.of( + RangeQuery.of( + range -> range.field(BIRTHDAY) + .lte(JsonData.of(value)))); + } + + + private String resolveDateOperator(final String operator) { + return operator == null ? "equal" : operator.toLowerCase(); + } + + private Optional applyStreetAddressCriteria(final PatientFilter criteria) { + + String address = criteria.getAddress(); + if (address != null && !address.isEmpty()) { + + String result = address.replace("(", "").replace(")", ""); + + return Optional.of( + NestedQuery.of( + nested -> nested.path(ADDRESSES) + .scoreMode(ChildScoreMode.Avg) + .query( + query -> query.simpleQueryString( + queryString -> queryString.fields("address.streetAddr1") + .defaultOperator(Operator.And) + .query(WildCards.startsWith(result)))))); + } + + return Optional.empty(); + } + + private Optional applyCityCriteria(final PatientFilter criteria) { + + String city = criteria.getCity(); + if (city != null && !city.isEmpty()) { + + return Optional.of( + NestedQuery.of( + nested -> nested.path(ADDRESSES) + .scoreMode(ChildScoreMode.Avg) + .query( + query -> query.simpleQueryString( + queryString -> queryString.fields("address.city") + .defaultOperator(Operator.And) + .query(WildCards.startsWith(city)))))); + } + + return Optional.empty(); + } + + private Optional applyZipcodeCriteria(final PatientFilter criteria) { + + String zipcode = criteria.getZip(); + if (zipcode != null && !zipcode.isEmpty()) { + + QueryVariant q = zipcode.length() < 5 + ? PrefixQuery.of( + prefix -> prefix.field("address.zip") + .value(zipcode)) + : MatchQuery.of( + match -> match.field("address.zip") + .query(zipcode)); + + return Optional.of( + NestedQuery.of( + nested -> nested.path(ADDRESSES) + .scoreMode(ChildScoreMode.Avg) + .query(q._toQuery()))); + } + + return Optional.empty(); + } +} diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientEventQueryResolver.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientEventQueryResolver.java new file mode 100644 index 0000000000..3f0028a06c --- /dev/null +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientEventQueryResolver.java @@ -0,0 +1,101 @@ +package gov.cdc.nbs.patient.search; + +import java.util.Optional; +import java.util.stream.Stream; +import org.springframework.stereotype.Component; +import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant; + +@Component +class PatientEventQueryResolver { + private static final String MORBIDITY_REPORTS = "morbidity_report_ids"; + private static final String DOCUMENTS = "document_ids"; + private static final String STATE_CASES = "state_case_ids"; + private static final String ABC_CASES = "abcs_case_ids"; + private static final String CITY_COUNTY_CASES = "city_case_ids"; + private static final String NOTIFICATIONS = "notification_ids"; + private static final String TREATMENTS = "treatment_ids"; + private static final String VACCINATIONS = "vaccination_ids"; + private static final String INVESTIGATIONS = "investigation_ids"; + private static final String LAB_REPORTS = "lab_report_ids"; + private static final String ACCESSIONS = "accession_ids"; + + Stream resolve(final PatientFilter criteria) { + return Stream.of( + applyMorbidityCriteria(criteria), + applyDocumentCriteria(criteria), + applyStateCaseCriteria(criteria), + applyAbcCaseCriteria(criteria), + applyCityCountyCaseCriteria(criteria), + applyNotificationCriteria(criteria), + applyTreatmentCriteria(criteria), + applyVaccinationCriteria(criteria), + applyInvestigationCriteria(criteria), + applyLabCriteria(criteria), + applyAccessionNumberCriteria(criteria)) + .flatMap(Optional::stream) + .map(QueryVariant::_toQuery); + } + + private Optional applyMorbidityCriteria(final PatientFilter criteria) { + return criteria.maybeMorbidity() + .map(identifier -> MatchQuery.of(match -> match.field(MORBIDITY_REPORTS).query(criteria.getMorbidity()))); + } + + private Optional applyDocumentCriteria(final PatientFilter criteria) { + return criteria.maybeDocument() + .map(identifier -> MatchQuery.of(match -> match.field(DOCUMENTS).query(criteria.getDocument()))); + } + + private Optional applyStateCaseCriteria(final PatientFilter criteria) { + return criteria.maybeStateCase() + .map(identifier -> MatchQuery.of(match -> match.field(STATE_CASES).query(criteria.getStateCase()))); + } + + private Optional applyAbcCaseCriteria(final PatientFilter criteria) { + return criteria.maybeAbcCase() + .map(identifier -> MatchQuery.of(match -> match.field(ABC_CASES).query(criteria.getAbcCase()))); + } + + private Optional applyCityCountyCaseCriteria(final PatientFilter criteria) { + return criteria.maybeCityCountyCase() + .map(identifier -> MatchQuery + .of(match -> match.field(CITY_COUNTY_CASES).query(criteria.getCityCountyCase()))); + } + + private Optional applyNotificationCriteria(final PatientFilter criteria) { + return criteria.maybeNotification() + .map(identifier -> MatchQuery + .of(match -> match.field(NOTIFICATIONS).query(criteria.getNotification()))); + } + + private Optional applyTreatmentCriteria(final PatientFilter criteria) { + return criteria.maybeTreatment() + .map(identifier -> MatchQuery + .of(match -> match.field(TREATMENTS).query(criteria.getTreatment()))); + } + + private Optional applyVaccinationCriteria(final PatientFilter criteria) { + return criteria.maybeVaccination() + .map(identifier -> MatchQuery + .of(match -> match.field(VACCINATIONS).query(criteria.getVaccination()))); + } + + private Optional applyInvestigationCriteria(final PatientFilter criteria) { + return criteria.maybeInvestigation() + .map(identifier -> MatchQuery + .of(match -> match.field(INVESTIGATIONS).query(criteria.getInvestigation()))); + } + + private Optional applyLabCriteria(final PatientFilter criteria) { + return criteria.maybeLabReport() + .map(identifier -> MatchQuery.of(match -> match.field(LAB_REPORTS).query(criteria.getLabReport()))); + } + + private Optional applyAccessionNumberCriteria(final PatientFilter criteria) { + return criteria.maybeAccessionNumber() + .map(identifier -> MatchQuery.of(match -> match.field(ACCESSIONS).query(criteria.getAccessionNumber()))); + } + +} diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientFilter.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientFilter.java index 16d22d1a79..dbf927d244 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientFilter.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientFilter.java @@ -19,6 +19,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Optional; @Getter @Setter @@ -59,8 +60,18 @@ public static class Identification { private String mortalityStatus; private String ethnicity; private List recordStatus; - private String treatmentId; - private String vaccinationId; + private String morbidity; + private String document; + private String stateCase; + private String abcCase; + private String cityCountyCase; + private String notification; + private String treatment; + private String vaccination; + private String investigation; + private String labReport; + private String accessionNumber; + private boolean disableSoundex; @JsonIgnore @Getter(AccessLevel.NONE) @@ -107,6 +118,107 @@ public PatientFilter withId(final String id) { return this; } + public PatientFilter withMorbidity(final String identifier) { + this.morbidity = identifier; + return this; + } + + public Optional maybeMorbidity() { + return Optional.ofNullable(morbidity); + } + + public PatientFilter withDocument(final String identifier) { + this.document = identifier; + return this; + } + + public Optional maybeDocument() { + return Optional.ofNullable(document); + } + + + public PatientFilter withStateCase(final String identifier) { + this.stateCase = identifier; + return this; + } + + public Optional maybeStateCase() { + return Optional.ofNullable(stateCase); + } + + + public PatientFilter withAbcCase(final String identifier) { + this.abcCase = identifier; + return this; + } + + public Optional maybeAbcCase() { + return Optional.ofNullable(abcCase); + } + + public PatientFilter withCityCountyCase(final String identifier) { + this.cityCountyCase = identifier; + return this; + } + + public Optional maybeCityCountyCase() { + return Optional.ofNullable(cityCountyCase); + } + + public PatientFilter withNotification(final String identifier) { + this.notification = identifier; + return this; + } + + public Optional maybeNotification() { + return Optional.ofNullable(notification); + } + + public PatientFilter withTreatment(final String identifier) { + this.treatment = identifier; + return this; + } + + public Optional maybeTreatment() { + return Optional.ofNullable(treatment); + } + + public PatientFilter withVaccination(final String identifier) { + this.vaccination = identifier; + return this; + } + + public Optional maybeVaccination() { + return Optional.ofNullable(vaccination); + } + + public PatientFilter withInvestigation(final String identifier) { + this.investigation = identifier; + return this; + } + + public Optional maybeInvestigation() { + return Optional.ofNullable(investigation); + } + + public PatientFilter withLabReport(final String identifier) { + this.labReport = identifier; + return this; + } + + public Optional maybeLabReport() { + return Optional.ofNullable(labReport); + } + + public PatientFilter withAccessiontNumber(final String identifier) { + this.accessionNumber = identifier; + return this; + } + + public Optional maybeAccessionNumber() { + return Optional.ofNullable(accessionNumber); + } + public PatientFilter withBornOnDay(final int day) { if (this.bornOn != null) { this.bornOn = this.bornOn.withEquals(this.bornOn.equals().withDay(day)); diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaQueryResolver.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaQueryResolver.java index c67e3a046f..6eab46c6e7 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaQueryResolver.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/PatientSearchCriteriaQueryResolver.java @@ -1,422 +1,30 @@ package gov.cdc.nbs.patient.search; +import java.util.stream.Stream; +import org.springframework.stereotype.Component; import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery; -import co.elastic.clients.elasticsearch._types.query_dsl.ChildScoreMode; -import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery; -import co.elastic.clients.elasticsearch._types.query_dsl.NestedQuery; -import co.elastic.clients.elasticsearch._types.query_dsl.Operator; -import co.elastic.clients.elasticsearch._types.query_dsl.PrefixQuery; import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant; -import co.elastic.clients.elasticsearch._types.query_dsl.RangeQuery; -import co.elastic.clients.elasticsearch._types.query_dsl.TermQuery; -import co.elastic.clients.json.JsonData; -import gov.cdc.nbs.patient.identifier.PatientLocalIdentifierResolver; -import gov.cdc.nbs.search.AdjustStrings; -import gov.cdc.nbs.search.WildCards; -import gov.cdc.nbs.search.criteria.date.DateCriteria; -import gov.cdc.nbs.search.criteria.date.DateCriteria.Between; -import gov.cdc.nbs.search.criteria.date.DateCriteria.Equals; -import gov.cdc.nbs.time.FlexibleInstantConverter; -import org.apache.commons.codec.language.Soundex; -import org.springframework.stereotype.Component; - -import java.time.LocalDate; -import java.util.Optional; -import java.util.stream.Stream; @Component class PatientSearchCriteriaQueryResolver { + private final PatientDemographicQueryResolver demographicQueryResolver; + private final PatientEventQueryResolver eventQueryResolver; - private static final String NAMES = "name"; - private static final String PHONES = "phone"; - private static final String EMAILS = "email"; - private static final String IDENTIFICATIONS = "entity_id"; - private static final String BIRTHDAY = "birth_time"; - private static final String ADDRESSES = "address"; - private final PatientSearchSettings settings; - private final PatientLocalIdentifierResolver resolver; - private final Soundex soundex; PatientSearchCriteriaQueryResolver( - final PatientSearchSettings settings, - final PatientLocalIdentifierResolver resolver) { - this.settings = settings; - this.resolver = resolver; - this.soundex = new Soundex(); + final PatientDemographicQueryResolver demographicQueryResolver, + final PatientEventQueryResolver eventQueryResolver) { + this.demographicQueryResolver = demographicQueryResolver; + this.eventQueryResolver = eventQueryResolver; } Query resolve(final PatientFilter criteria) { - return Stream.of( - applyPatientIdentifierCriteria(criteria), - applyFirstNameCriteria(criteria), - applyLastNameCriteria(criteria), - applyPhoneNumberCriteria(criteria), - applyEmailCriteria(criteria), - applyIdentificationCriteria(criteria), - applyDateOfBirthCriteria(criteria), - applyDateOfBirthLowRangeCriteria(criteria), - applyDateOfBirthHighRangeCriteria(criteria), - applyStreetAddressCriteria(criteria), - applyCityCriteria(criteria), - applyZipcodeCriteria(criteria)).flatMap(Optional::stream) - .map(QueryVariant::_toQuery) - .reduce( + return Stream.concat( + demographicQueryResolver.resolve(criteria), + eventQueryResolver.resolve(criteria)).reduce( new BoolQuery.Builder(), BoolQuery.Builder::must, (one, two) -> one.must(two.build().must())) .build()._toQuery(); } - - private Optional applyPatientIdentifierCriteria(final PatientFilter criteria) { - if (criteria.getId() != null) { - String shortOrLongIdStripped = criteria.getId().strip(); - - if (shortOrLongIdStripped.isEmpty()) { - return Optional.empty(); - } - - if (Character.isDigit(shortOrLongIdStripped.charAt(0))) { - // This may be a short id, resolve the local id and then search for it - try { - long shortId = Long.parseLong(shortOrLongIdStripped); - - String localId = resolver.resolve(shortId); - - return applyLocalId(localId); - - } catch (NumberFormatException exception) { - // skip these criteria. it's not a short id or long id - } - } else { - return applyLocalId(shortOrLongIdStripped); - } - } - - return Optional.empty(); - } - - private Optional applyLocalId(final String local) { - return Optional.of( - TermQuery.of( - query -> query.field("local_id") - .value(local))); - } - - private Optional applyFirstNameCriteria(final PatientFilter criteria) { - String name = criteria.getFirstName(); - - if (name != null && !name.isBlank()) { - - String encoded; - if (criteria.isDisableSoundex()) { - encoded = ""; - } else { - encoded = soundex.encode(name.trim()); - } - - return Optional.of( - BoolQuery.of( - bool -> bool.should( - should -> should.nested( - nested -> nested.path(NAMES) - .scoreMode(ChildScoreMode.Max) - .query( - query -> query.bool( - legal -> legal.filter( - filter -> filter.term( - term -> term.field("name.nm_use_cd.keyword") - .value("L"))) - .must( - primary -> primary.match( - match -> match - .field("name.firstNm") - .query(name) - .boost(settings.first().primary()) - - )))))).should( - should -> should.nested( - nested -> nested.path(NAMES) - .scoreMode(ChildScoreMode.Avg) - .query( - nonPrimary -> nonPrimary.simpleQueryString( - queryString -> queryString - .fields("name.firstNm") - .query(WildCards.startsWith(name)) - .boost(settings.first().nonPrimary()))))) - .should( - should -> should.nested( - nested -> nested.path(NAMES) - .scoreMode(ChildScoreMode.Avg) - .boost(settings.first().soundex()) - .query( - query -> query.term( - term -> term - .field("name.firstNmSndx.keyword") - .value(encoded))))))); - } - return Optional.empty(); - } - - private Optional applyLastNameCriteria(final PatientFilter criteria) { - String name = AdjustStrings.withoutHyphens(criteria.getLastName()); - - if (name != null && !name.isBlank()) { - String encoded; - if (criteria.isDisableSoundex()) { - encoded = ""; - } else { - encoded = soundex.encode(name.trim()); - } - - return Optional.of( - BoolQuery.of( - bool -> bool.should( - should -> should.nested( - nested -> nested.path(NAMES) - .scoreMode(ChildScoreMode.Max) - .query( - query -> query.bool( - legal -> legal.filter( - filter -> filter.term( - term -> term.field("name.nm_use_cd.keyword") - .value("L"))) - .must( - primary -> primary.match( - match -> match - .field("name.lastNm") - .query(name) - .boost(settings.first().primary()))))))) - .should( - should -> should.nested( - nested -> nested.path(NAMES) - .scoreMode(ChildScoreMode.Avg) - .query( - query -> query.simpleQueryString( - nonPrimary -> nonPrimary - .fields("name.lastNm") - .query(WildCards.startsWith(name)) - .boost(settings.first().nonPrimary()))))) - .should( - should -> should.nested( - nested -> nested.path(NAMES) - .scoreMode(ChildScoreMode.Avg) - .boost(settings.first().soundex()) - .query( - query -> query.term( - term -> term - .field("name.lastNmSndx.keyword") - .value(encoded))))))); - } - return Optional.empty(); - } - - private Optional applyPhoneNumberCriteria(final PatientFilter criteria) { - - String number = AdjustStrings.withoutSpecialCharacters(criteria.getPhoneNumber()); - - if (number != null && !number.isEmpty()) { - - return Optional.of( - NestedQuery.of( - nested -> nested.path(PHONES) - .scoreMode(ChildScoreMode.Avg) - .query( - query -> query.wildcard( - wildcard -> wildcard.field("phone.telephoneNbr") - .value(WildCards.contains(number)))))); - - } - - return Optional.empty(); - } - - private Optional applyEmailCriteria(final PatientFilter criteria) { - - String email = criteria.getEmail(); - if (email != null && !email.isEmpty()) { - - return Optional.of( - NestedQuery.of( - nested -> nested.path(EMAILS) - .scoreMode(ChildScoreMode.Avg) - .query( - query -> query.simpleQueryString( - queryString -> queryString.fields("email.emailAddress") - .defaultOperator(Operator.And) - .query(email))))); - } - - return Optional.empty(); - } - - private Optional applyIdentificationCriteria(final PatientFilter criteria) { - - PatientFilter.Identification identification = criteria.getIdentification(); - - String type = identification.getIdentificationType(); - String value = AdjustStrings.withoutSpecialCharacters(identification.getIdentificationNumber()); - - if (type != null && (value != null && !value.isEmpty())) { - return Optional.of( - NestedQuery.of( - nested -> nested.path(IDENTIFICATIONS) - .scoreMode(ChildScoreMode.Avg) - .query( - query -> query.bool( - bool -> bool.filter( - filter -> filter.term( - term -> term.field("entity_id.typeCd.keyword") - .value(type))) - .must( - must -> must.prefix( - prefix -> prefix.field("entity_id.rootExtensionTxt").caseInsensitive(true) - .value(value))))))); - } - return Optional.empty(); - } - - private Optional applyDateOfBirthCriteria(final PatientFilter criteria) { - - LocalDate dateOfBirth = criteria.getDateOfBirth(); - - if (dateOfBirth != null) { - String operator = resolveDateOperator(criteria.getDateOfBirthOperator()); - String value = FlexibleInstantConverter.toString(dateOfBirth); - - return switch (operator) { - case "before" -> Optional.of( - RangeQuery.of( - range -> range.field(BIRTHDAY) - .lt(JsonData.of(value)))); - case "after" -> Optional.of( - RangeQuery.of( - range -> range.field(BIRTHDAY) - .gt(JsonData.of(value)))); - default -> Optional.of( - MatchQuery.of( - match -> match.field(BIRTHDAY) - .query(value))); - }; - } - - DateCriteria dateCriteria = criteria.getBornOn(); - if (dateCriteria != null && dateCriteria.equals() != null && dateCriteria.equals().isCompleteDate()) { - Equals equals = dateCriteria.equals(); - String value = FlexibleInstantConverter.toString(LocalDate.of(equals.year(), equals.month(), equals.day())); - return Optional.of( - MatchQuery.of( - match -> match.field(BIRTHDAY) - .query(value))); - - } - - return Optional.empty(); - } - - private Optional applyDateOfBirthLowRangeCriteria(final PatientFilter criteria) { - DateCriteria dateCriteria = criteria.getBornOn(); - if (dateCriteria == null) { - return Optional.empty(); - } - Between betweenDate = dateCriteria.between(); - if (betweenDate == null || betweenDate.from() == null) { - return Optional.empty(); - } - - - String value = FlexibleInstantConverter.toString(betweenDate.from()); - - return Optional.of( - RangeQuery.of( - range -> range.field(BIRTHDAY) - .gte(JsonData.of(value)))); - } - - private Optional applyDateOfBirthHighRangeCriteria(final PatientFilter criteria) { - DateCriteria dateCriteria = criteria.getBornOn(); - if (dateCriteria == null) { - return Optional.empty(); - } - Between betweenDate = dateCriteria.between(); - if (betweenDate == null || betweenDate.to() == null) { - return Optional.empty(); - } - - String value = FlexibleInstantConverter.toString(betweenDate.to()); - - return Optional.of( - RangeQuery.of( - range -> range.field(BIRTHDAY) - .lte(JsonData.of(value)))); - } - - - private String resolveDateOperator(final String operator) { - return operator == null ? "equal" : operator.toLowerCase(); - } - - private Optional applyStreetAddressCriteria(final PatientFilter criteria) { - - String address = criteria.getAddress(); - if (address != null && !address.isEmpty()) { - - String result = address.replace("(", "").replace(")", ""); - - return Optional.of( - NestedQuery.of( - nested -> nested.path(ADDRESSES) - .scoreMode(ChildScoreMode.Avg) - .query( - query -> query.simpleQueryString( - queryString -> queryString.fields("address.streetAddr1") - .defaultOperator(Operator.And) - .query(WildCards.startsWith(result)))))); - } - - return Optional.empty(); - } - - private Optional applyCityCriteria(final PatientFilter criteria) { - - String city = criteria.getCity(); - if (city != null && !city.isEmpty()) { - - return Optional.of( - NestedQuery.of( - nested -> nested.path(ADDRESSES) - .scoreMode(ChildScoreMode.Avg) - .query( - query -> query.simpleQueryString( - queryString -> queryString.fields("address.city") - .defaultOperator(Operator.And) - .query(WildCards.startsWith(city)))))); - } - - return Optional.empty(); - } - - private Optional applyZipcodeCriteria(final PatientFilter criteria) { - - String zipcode = criteria.getZip(); - if (zipcode != null && !zipcode.isEmpty()) { - - QueryVariant q = zipcode.length() < 5 - ? PrefixQuery.of( - prefix -> prefix.field("address.zip") - .value(zipcode)) - : MatchQuery.of( - match -> match.field("address.zip") - .query(zipcode)); - - return Optional.of( - NestedQuery.of( - nested -> nested.path(ADDRESSES) - .scoreMode(ChildScoreMode.Avg) - .query(q._toQuery()))); - } - - return Optional.empty(); - } - } diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientFinder.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientFinder.java index 70e3ce82c4..69f9011839 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientFinder.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientFinder.java @@ -110,6 +110,7 @@ FOR XML PATH('') Public_health_case phc JOIN Act_id ai ON phc.public_health_case_uid = ai.act_uid and ai.type_cd='STATE' + and (ai.assigning_authority_cd <> 'ABCS' OR ai.assigning_authority_cd IS NULL) and ai.root_extension_txt is not null and ai.root_extension_txt<>'' JOIN participation par ON par.act_uid = phc.public_health_case_uid @@ -129,6 +130,7 @@ FOR XML PATH('') JOIN Act_id ai ON phc.public_health_case_uid = ai.act_uid and ai.act_id_seq=2 and ai.type_cd='STATE' + and ai.assigning_authority_cd='ABCS' and ai.root_extension_txt is not null and ai.root_extension_txt<>'' JOIN participation par ON par.act_uid = phc.public_health_case_uid @@ -240,13 +242,13 @@ FOR XML PATH('') private static final int MORBIDITY_REPORT_IDS_COLUMN = 9; private static final int TREATMENT_IDS_COLUMN = 10; private static final int VACCINATION_IDS_COLUMN = 11; - private static final int ABCS_CASE_IDS_COLUMN = 12; - private static final int CITY_CASE_IDS_COLUMN = 13; - private static final int STATE_CASE_IDS_COLUMN = 14; - private static final int ACCESSION_IDS_COLUMN = 15; + private static final int STATE_CASE_IDS_COLUMN = 12; + private static final int ABCS_CASE_IDS_COLUMN = 13; + private static final int CITY_CASE_IDS_COLUMN = 14; + private static final int NOTIFICATION_IDS_COLUMN = 15; private static final int INVESTIGATION_IDS_COLUMN = 16; private static final int LAB_REPORT_IDS_COLUMN = 17; - private static final int NOTIFICATION_IDS_COLUMN = 18; + private static final int ACCESSION_IDS_COLUMN = 18; private final JdbcTemplate template; private final SearchablePatientRowMapper mapper; diff --git a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientRowMapper.java b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientRowMapper.java index 47a5c2a887..1d6df7e79e 100644 --- a/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientRowMapper.java +++ b/apps/modernization-api/src/main/java/gov/cdc/nbs/patient/search/indexing/SearchablePatientRowMapper.java @@ -51,9 +51,9 @@ public SearchablePatient mapRow(final ResultSet resultSet, int rowNum) throws SQ String morbidityReportIds = resultSet.getString(columns.morbidityReportIds()); String treatmentIds = resultSet.getString(columns.treatmentIds()); String vaccinationIds = resultSet.getString(columns.vaccinationIds()); + String stateCaseIds = resultSet.getString(columns.stateCaseIds()); String abcsCaseIds = resultSet.getString(columns.abcsCaseIds()); String cityCaseIds = resultSet.getString(columns.cityCaseIds()); - String stateCaseIds = resultSet.getString(columns.stateCaseIds()); String accessionIds = resultSet.getString(columns.accessionIds()); String investigationIds = resultSet.getString(columns.investigationIds()); String labReportIds = resultSet.getString(columns.labReportIds()); diff --git a/apps/modernization-api/src/main/resources/graphql/patient-search.graphqls b/apps/modernization-api/src/main/resources/graphql/patient-search.graphqls index c5a73c8e61..803dd2a1a5 100644 --- a/apps/modernization-api/src/main/resources/graphql/patient-search.graphqls +++ b/apps/modernization-api/src/main/resources/graphql/patient-search.graphqls @@ -40,8 +40,17 @@ input PersonFilter { zip: String mortalityStatus: String ethnicity: String - vaccinationId: String - treatmentId: String + vaccination: String + morbidity: String + document: String + stateCase: String + abcCase: String + cityCountyCase: String + notification: String + treatment: String + investigation: String + labReport: String + accessionNumber: String disableSoundex: Boolean recordStatus: [RecordStatus!]! } diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/AbcCaseIdentifier.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/AbcCaseIdentifier.java new file mode 100644 index 0000000000..c7ef6c54f9 --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/AbcCaseIdentifier.java @@ -0,0 +1,8 @@ +package gov.cdc.nbs.event.investigation; + +import io.cucumber.spring.ScenarioScope; + +@ScenarioScope +public record AbcCaseIdentifier(Long identifier, String local) { + +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/CityCountyCaseIdentifier.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/CityCountyCaseIdentifier.java new file mode 100644 index 0000000000..e596b20dab --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/CityCountyCaseIdentifier.java @@ -0,0 +1,8 @@ +package gov.cdc.nbs.event.investigation; + +import io.cucumber.spring.ScenarioScope; + +@ScenarioScope +public record CityCountyCaseIdentifier(Long identifier, String local) { + +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationMother.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationMother.java index 73145ceb47..b3a8bf4ce5 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationMother.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationMother.java @@ -34,6 +34,9 @@ public class InvestigationMother { private final Available available; private final Active active; + private final Active activeAbcCase; + private final Active activeStateCase; + private final Active activeCityCountyCase; private final PatientMother patientMother; private final TestInvestigationCleaner cleaner; @@ -45,6 +48,9 @@ public class InvestigationMother { final Available available, final Active active, final PatientMother patientMother, + final Active activeAbcCase, + final Active activeStateCase, + final Active activeCityCountyCase, final TestInvestigationCleaner cleaner) { this.idGenerator = idGenerator; this.settings = settings; @@ -53,6 +59,9 @@ public class InvestigationMother { this.available = available; this.active = active; this.patientMother = patientMother; + this.activeAbcCase = activeAbcCase; + this.activeStateCase = activeStateCase; + this.activeCityCountyCase = activeCityCountyCase; this.cleaner = cleaner; } @@ -221,47 +230,52 @@ void reported(final InvestigationIdentifier identifier, final Instant on) { void relatedToABCSCase( final InvestigationIdentifier identifier, - final String number) { + final String abcCaseId) { PublicHealthCase investigation = managed(identifier); Act act = investigation.act(); ActId relatedTo = new ActId(new ActIdId(act.getId(), 2)); relatedTo.setTypeCd("STATE"); - relatedTo.setRootExtensionTxt(number); + relatedTo.setAssigningAuthorityCd("ABCS"); + relatedTo.setRootExtensionTxt(abcCaseId); act.addIdentifier(relatedTo); + activeAbcCase.active(new AbcCaseIdentifier(act.getId(), abcCaseId)); } void relatedToCountyCase( final InvestigationIdentifier identifier, - final String number) { + final String cityCountyCaseId) { PublicHealthCase investigation = managed(identifier); Act act = investigation.act(); ActId relatedTo = new ActId(new ActIdId(act.getId(), 2)); relatedTo.setTypeCd("CITY"); - relatedTo.setRootExtensionTxt(number); + relatedTo.setRootExtensionTxt(cityCountyCaseId); act.addIdentifier(relatedTo); + activeCityCountyCase.active(new CityCountyCaseIdentifier(act.getId(), cityCountyCaseId)); } void relatedToStateCase( final InvestigationIdentifier identifier, - final String number) { + final String stateCaseId) { PublicHealthCase investigation = managed(identifier); Act act = investigation.act(); ActId relatedTo = new ActId(new ActIdId(act.getId(), 1)); relatedTo.setTypeCd("STATE"); - relatedTo.setRootExtensionTxt(number); + relatedTo.setRootExtensionTxt(stateCaseId); act.addIdentifier(relatedTo); + activeStateCase.active(new StateCaseIdentifier(act.getId(), stateCaseId)); + } void relatedToOutbreak( diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSteps.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSteps.java index f685518524..6ff07a2d8c 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSteps.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSteps.java @@ -32,8 +32,7 @@ public InvestigationSteps( final Active activeProvider, final Active activeInvestigation, final InvestigationMother mother, - final ConceptParameterResolver resolver - ) { + final ConceptParameterResolver resolver) { this.activePatient = activePatient; this.activeJurisdiction = activeJurisdiction; this.activeProgramArea = activeProgramArea; @@ -54,9 +53,7 @@ public void the_patient_is_a_subject_of_an_investigation() { p -> mother.create( p, activeJurisdiction.active(), - activeProgramArea.active() - ) - ); + activeProgramArea.active())); } @Given("the patient is a subject of {int} investigations") @@ -69,23 +66,19 @@ public void the_patient_is_a_subject_N_investigation(final int n) { mother.create( patient, jurisdiction, - programArea - ); + programArea); } } @Given("the investigation is for {programArea} within {jurisdiction}") public void the_investigation_is_within( final ProgramAreaIdentifier programArea, - final JurisdictionIdentifier jurisdiction - ) { + final JurisdictionIdentifier jurisdiction) { activeInvestigation.maybeActive().ifPresent( investigation -> mother.within( investigation, programArea, - jurisdiction - ) - ); + jurisdiction)); } @Given("the investigation is for the {condition} condition") @@ -172,7 +165,7 @@ public void the_investigation_is_related_to_state_case(final String number) { .ifPresent(active -> mother.relatedToStateCase(active, number)); } - @Given("the investigation is related to ABCS Case {string}") + @Given("the investigation is related to ABCs Case {string}") public void the_investigation_is_related_to_ABCS_case(final String number) { this.activeInvestigation.maybeActive() .ifPresent(active -> mother.relatedToABCSCase(active, number)); @@ -190,9 +183,7 @@ public void the_investigation_was_investigated_by_the_provider() { .ifPresent( active -> mother.investigatedBy( active, - activeProvider.active() - ) - ); + activeProvider.active())); } @Given("the investigation was reported by the {organization} facility") @@ -207,15 +198,12 @@ public void the_investigation_was_reported_by_the_provider() { .ifPresent( active -> mother.reportedBy( active, - activeProvider.active() - ) - ); + activeProvider.active())); } @Given("the investigation is related to the {outbreak} outbreak") public void the_investigation_is_related_to_the_outbreak(final String outbreak) { this.activeInvestigation.maybeActive().ifPresent( - active -> mother.relatedToOutbreak(active, outbreak) - ); + active -> mother.relatedToOutbreak(active, outbreak)); } } diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSupportConfiguration.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSupportConfiguration.java index 1fa488afae..97e371b64f 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSupportConfiguration.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/InvestigationSupportConfiguration.java @@ -18,4 +18,19 @@ Available availableInvestigation() { return new Available<>(); } + @Bean + Active activeAbcCaseId() { + return new Active<>(); + } + + @Bean + Active activeStateCaseId() { + return new Active<>(); + } + + @Bean + Active activeCityCountyCaseId() { + return new Active<>(); + } + } diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/StateCaseIdentifier.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/StateCaseIdentifier.java new file mode 100644 index 0000000000..5bab0cae69 --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/investigation/StateCaseIdentifier.java @@ -0,0 +1,8 @@ +package gov.cdc.nbs.event.investigation; + +import io.cucumber.spring.ScenarioScope; + +@ScenarioScope +public record StateCaseIdentifier(Long identifier, String local) { + +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/AccessionIdentifier.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/AccessionIdentifier.java new file mode 100644 index 0000000000..c387de371c --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/AccessionIdentifier.java @@ -0,0 +1,8 @@ +package gov.cdc.nbs.event.report.lab; + +import io.cucumber.spring.ScenarioScope; + +@ScenarioScope +public record AccessionIdentifier(Long identifier, String local) { + +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportMother.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportMother.java index f62a74f4c2..5bc4dd567a 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportMother.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportMother.java @@ -41,7 +41,7 @@ public class LabReportMother { private final SequentialIdentityGenerator idGenerator; private final EntityManager entityManager; private final TestLabReportCleaner cleaner; - + private final Active activeAccessionIdentifier; private final Active active; private final Available available; @@ -54,14 +54,15 @@ public class LabReportMother { final TestLabReportCleaner cleaner, final Active active, final Available available, - final PatientMother patientMother - ) { + final Active activeAccessionIdentifier, + final PatientMother patientMother) { this.settings = settings; this.idGenerator = idGenerator; this.entityManager = entityManager; this.cleaner = cleaner; this.active = active; this.available = available; + this.activeAccessionIdentifier = activeAccessionIdentifier; this.patientMother = patientMother; } @@ -74,8 +75,7 @@ void create( final PatientIdentifier patient, final OrganizationIdentifier organization, final JurisdictionIdentifier jurisdiction, - final ProgramAreaIdentifier programArea - ) { + final ProgramAreaIdentifier programArea) { PatientIdentifier revision = patientMother.revise(patient); // Observation long identifier = idGenerator.next(); @@ -113,8 +113,7 @@ void create( private void within( final Observation observation, final ProgramAreaIdentifier programArea, - final JurisdictionIdentifier jurisdiction - ) { + final JurisdictionIdentifier jurisdiction) { observation.setProgAreaCd(programArea.code()); observation.setJurisdictionCd(jurisdiction.code()); observation.setProgramJurisdictionOid(programArea.oid(jurisdiction)); @@ -168,8 +167,7 @@ private void include(final LabReportIdentifier identifier) { void within( final LabReportIdentifier identifier, final ProgramAreaIdentifier programArea, - final JurisdictionIdentifier jurisdiction - ) { + final JurisdictionIdentifier jurisdiction) { Observation lab = managed(identifier); within(lab, programArea, jurisdiction); } @@ -242,6 +240,7 @@ void filledBy(final LabReportIdentifier identifier, final String number) { filler.setRootExtensionTxt(number); act.addIdentifier(filler); + activeAccessionIdentifier.active(new AccessionIdentifier(act.getId(), number)); } void forPregnantPatient(final LabReportIdentifier identifier) { @@ -257,8 +256,7 @@ void receivedOn(final LabReportIdentifier identifier, final Instant date) { void created( final LabReportIdentifier identifier, final long by, - final Instant on - ) { + final Instant on) { Observation lab = managed(identifier); lab.setAddTime(on); lab.setAddUserId(by); @@ -267,8 +265,7 @@ void created( void updated( final LabReportIdentifier identifier, final long by, - final Instant on - ) { + final Instant on) { Observation lab = managed(identifier); lab.setLastChgUserId(by); lab.setLastChgTime(on); diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportSteps.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportSteps.java index 86f16b6701..9fd7b07aa3 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportSteps.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportSteps.java @@ -109,6 +109,7 @@ public void the_lab_report_is_for_a_pregnant_patient() { activeReport.maybeActive().ifPresent(reportMother::forPregnantPatient); } + @Given("the lab report has an Accession number of {string}") @Given("the lab report was filled by {string}") public void the_lab_report_was_filled_by(final String filler) { activeReport.maybeActive().ifPresent(lab -> reportMother.filledBy(lab, filler)); diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportingSupportConfiguration.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportingSupportConfiguration.java index c6a1813f93..b5efd125a3 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportingSupportConfiguration.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/report/lab/LabReportingSupportConfiguration.java @@ -17,4 +17,9 @@ Active activeLabReport() { Available availableLabReport() { return new Available<>(); } + + @Bean + Active activeAccessionIdentifier() { + return new Active<>(); + } } diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/search/investigation/InvestigationSearchCriteriaSteps.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/search/investigation/InvestigationSearchCriteriaSteps.java index 9922986f23..780e497088 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/event/search/investigation/InvestigationSearchCriteriaSteps.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/event/search/investigation/InvestigationSearchCriteriaSteps.java @@ -261,7 +261,7 @@ public void i_want_to_find_investigations_for_county_case(final String number) { number))); } - @Given("I want to find investigations for the ABCS Case {string}") + @Given("I want to find investigations for the ABCs Case {string}") public void i_want_to_find_investigations_for_ABCS_case(final String number) { this.activeCriteria.maybeActive().ifPresent( criteria -> criteria.setEventId( diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationConfiguration.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationConfiguration.java new file mode 100644 index 0000000000..502effe179 --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationConfiguration.java @@ -0,0 +1,14 @@ +package gov.cdc.nbs.patient.profile.vaccination; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import gov.cdc.nbs.testing.support.Active; + +@Configuration +public class VaccinationConfiguration { + + @Bean + public Active activeVaccination() { + return new Active<>(); + } +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationIdentifier.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationIdentifier.java new file mode 100644 index 0000000000..6dbbe55e23 --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationIdentifier.java @@ -0,0 +1,8 @@ +package gov.cdc.nbs.patient.profile.vaccination; + +import io.cucumber.spring.ScenarioScope; + +@ScenarioScope +public record VaccinationIdentifier(Long identifier, String local) { + +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationMother.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationMother.java index 5bdb4cf86e..c8cd4f48f5 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationMother.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/profile/vaccination/VaccinationMother.java @@ -7,6 +7,7 @@ import gov.cdc.nbs.entity.odse.ParticipationId; import gov.cdc.nbs.identity.MotherSettings; import gov.cdc.nbs.testing.identity.SequentialIdentityGenerator; +import gov.cdc.nbs.testing.support.Active; import gov.cdc.nbs.support.util.RandomUtil; import org.springframework.stereotype.Component; @@ -21,6 +22,7 @@ class VaccinationMother { private final MotherSettings settings; private final SequentialIdentityGenerator idGenerator; private final EntityManager entityManager; + private final Active activeVaccination; private final TestVaccinationCleaner cleaner; private final TestVaccinations vaccinations; @@ -29,13 +31,15 @@ class VaccinationMother { final SequentialIdentityGenerator idGenerator, final EntityManager entityManager, final TestVaccinationCleaner cleaner, - final TestVaccinations vaccinations + final TestVaccinations vaccinations, + final Active activeVaccination ) { this.settings = settings; this.idGenerator = idGenerator; this.entityManager = entityManager; this.cleaner = cleaner; this.vaccinations = vaccinations; + this.activeVaccination = activeVaccination; } void reset() { @@ -68,6 +72,7 @@ Intervention vaccinate(final long patient) { entityManager.persist(vaccination); this.vaccinations.available(vaccination.getId()); + activeVaccination.active(new VaccinationIdentifier(identifier, local)); return vaccination; } diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchEventIdSteps.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchEventIdSteps.java new file mode 100644 index 0000000000..60f11bc9ee --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/search/PatientSearchEventIdSteps.java @@ -0,0 +1,145 @@ +package gov.cdc.nbs.patient.search; + +import gov.cdc.nbs.event.document.CaseReportIdentifier; +import gov.cdc.nbs.event.investigation.AbcCaseIdentifier; +import gov.cdc.nbs.event.investigation.CityCountyCaseIdentifier; +import gov.cdc.nbs.event.investigation.InvestigationIdentifier; +import gov.cdc.nbs.event.investigation.NotificationIdentifier; +import gov.cdc.nbs.event.investigation.StateCaseIdentifier; +import gov.cdc.nbs.event.report.lab.AccessionIdentifier; +import gov.cdc.nbs.event.report.lab.LabReportIdentifier; +import gov.cdc.nbs.event.report.morbidity.MorbidityReportIdentifier; +import gov.cdc.nbs.patient.profile.vaccination.VaccinationIdentifier; +import gov.cdc.nbs.patient.treatment.TreatmentIdentifier; +import gov.cdc.nbs.testing.support.Active; +import io.cucumber.java.en.Given; + +public class PatientSearchEventIdSteps { + private final Active activeCriteria; + private final Active activeMorbidityReport; + private final Active activeLabReport; + private final Active activeCaseReport; + private final Active activeStateCase; + private final Active activeAbcCase; + private final Active activeCityCountyCase; + private final Active activeNotification; + private final Active activeVaccination; + private final Active activeInvestigation; + private final Active activeTreatment; + private final Active activeAccessionNumber; + + PatientSearchEventIdSteps( + final Active activeCriteria, + final Active activeLabReport, + final Active activeCaseReport, + final Active activeStateCase, + final Active activeAbcCase, + final Active activeCityCountyCase, + final Active activeNotification, + final Active activeTreatment, + final Active activeVaccination, + final Active activeInvestigation, + final Active activeMorbidityReport, + final Active activeAccessionNumber) { + this.activeCriteria = activeCriteria; + this.activeMorbidityReport = activeMorbidityReport; + this.activeLabReport = activeLabReport; + this.activeStateCase = activeStateCase; + this.activeAbcCase = activeAbcCase; + this.activeCityCountyCase = activeCityCountyCase; + this.activeNotification = activeNotification; + this.activeTreatment = activeTreatment; + this.activeVaccination = activeVaccination; + this.activeInvestigation = activeInvestigation; + this.activeCaseReport = activeCaseReport; + this.activeAccessionNumber = activeAccessionNumber; + } + + @Given("I would like to search for a patient using the Morbidity Report ID") + public void i_would_like_to_search_for_a_patient_using_the_morbidity_report_ID() { + this.activeMorbidityReport.maybeActive() + .map(MorbidityReportIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withMorbidity(identifier))); + } + + @Given("I would like to search for a patient using the Document ID") + public void i_would_like_to_search_for_a_patient_using_the_document_ID() { + this.activeCaseReport.maybeActive() + .map(CaseReportIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withDocument(identifier))); + } + + @Given("I would like to search for a patient using the State Case ID") + public void i_would_like_to_search_for_a_patient_using_the_state_case_ID() { + this.activeStateCase.maybeActive() + .map(StateCaseIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withStateCase(identifier))); + } + + @Given("I would like to search for a patient using the ABC Case ID") + public void i_would_like_to_search_for_a_patient_using_the_abc_case_ID() { + this.activeAbcCase.maybeActive() + .map(AbcCaseIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withAbcCase(identifier))); + } + + @Given("I would like to search for a patient using the County Case ID") + public void i_would_like_to_search_for_a_patient_using_the_county_case_ID() { + this.activeCityCountyCase.maybeActive() + .map(CityCountyCaseIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withCityCountyCase(identifier))); + } + + @Given("I would like to search for a patient using the Notification ID") + public void i_would_like_to_search_for_a_patient_using_the_notification_ID() { + this.activeNotification.maybeActive() + .map(NotificationIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withNotification(identifier))); + } + + @Given("I would like to search for a patient using the Treatment ID") + public void i_would_like_to_search_for_a_patient_using_the_treatment_ID() { + this.activeTreatment.maybeActive() + .map(TreatmentIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withTreatment(identifier))); + } + + @Given("I would like to search for a patient using the Vaccination ID") + public void i_would_like_to_search_for_a_patient_using_the_vaccination_ID() { + this.activeVaccination.maybeActive() + .map(VaccinationIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withVaccination(identifier))); + } + + @Given("I would like to search for a patient using the Investigation ID") + public void i_would_like_to_search_for_a_patient_using_the_investigation_ID() { + this.activeInvestigation.maybeActive() + .map(InvestigationIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withInvestigation(identifier))); + } + + @Given("I would like to search for a patient using the Lab Report ID") + public void i_would_like_to_search_for_a_patient_using_the_lab_report_ID() { + this.activeLabReport.maybeActive() + .map(LabReportIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withLabReport(identifier))); + } + + @Given("I would like to search for a patient using the Accession number") + public void i_would_like_to_search_for_a_patient_using_the_accession_number() { + this.activeAccessionNumber.maybeActive() + .map(AccessionIdentifier::local) + .ifPresent( + identifier -> this.activeCriteria.active(criteria -> criteria.withAccessiontNumber(identifier))); + } +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentConfiguration.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentConfiguration.java new file mode 100644 index 0000000000..65044ad4cb --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentConfiguration.java @@ -0,0 +1,14 @@ +package gov.cdc.nbs.patient.treatment; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import gov.cdc.nbs.testing.support.Active; + +@Configuration +class TreatmentConfiguration { + + @Bean + Active activeTreatment() { + return new Active<>(); + } +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentIdentifier.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentIdentifier.java new file mode 100644 index 0000000000..72553fcd43 --- /dev/null +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentIdentifier.java @@ -0,0 +1,8 @@ +package gov.cdc.nbs.patient.treatment; + +import io.cucumber.spring.ScenarioScope; + +@ScenarioScope +public record TreatmentIdentifier(Long identifier, String local) { + +} diff --git a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentMother.java b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentMother.java index b656e22da6..775472c6a7 100644 --- a/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentMother.java +++ b/apps/modernization-api/src/test/java/gov/cdc/nbs/patient/treatment/TreatmentMother.java @@ -8,6 +8,7 @@ import gov.cdc.nbs.entity.odse.TreatmentAdministered; import gov.cdc.nbs.identity.MotherSettings; import gov.cdc.nbs.testing.identity.SequentialIdentityGenerator; +import gov.cdc.nbs.testing.support.Active; import gov.cdc.nbs.support.util.RandomUtil; import org.springframework.stereotype.Component; @@ -26,19 +27,22 @@ class TreatmentMother { private final TestTreatmentCleaner cleaner; private final TestTreatments treatments; + private final Active activeTreatment; TreatmentMother( final MotherSettings settings, final SequentialIdentityGenerator idGenerator, final EntityManager entityManager, final TestTreatmentCleaner cleaner, - final TestTreatments treatments + final TestTreatments treatments, + final Active activeTreatment ) { this.settings = settings; this.idGenerator = idGenerator; this.entityManager = entityManager; this.cleaner = cleaner; this.treatments = treatments; + this.activeTreatment = activeTreatment; } void reset() { @@ -74,7 +78,7 @@ Treatment treated(final long patient, final long investigation) { this.entityManager.persist(treatment); this.treatments.available(identifier); - + this.activeTreatment.active(new TreatmentIdentifier(identifier, localId)); return treatment; } diff --git a/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.eventId.feature b/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.eventId.feature new file mode 100644 index 0000000000..f0e49e1171 --- /dev/null +++ b/apps/modernization-api/src/test/resources/features/patient/search/PatientSearch.eventId.feature @@ -0,0 +1,111 @@ +@patient @patient-search @patient-search-event +Feature: Patient Search by Event ID + + Background: + Given I am logged into NBS + And I can "find" any "patient" + + Scenario: I can find a patient with a Morbidity Report ID + Given I have a patient + And the patient has a Morbidity Report + And patients are available for search + And I would like to search for a patient using the Morbidity Report ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a Document ID + Given I have a patient + And the patient has a Case Report + And patients are available for search + And I would like to search for a patient using the Document ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a State Case ID + Given I have a patient + And the patient is a subject of an investigation + And the investigation is related to State Case "200021" + And patients are available for search + And I would like to search for a patient using the State Case ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a ABC Case ID + Given I have a patient + And the patient is a subject of an investigation + And the investigation is related to ABCs Case "1013675" + And patients are available for search + And I would like to search for a patient using the ABC Case ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a County Case ID + Given I have a patient + And the patient is a subject of an investigation + And the investigation is related to County Case "2023657" + And patients are available for search + And I would like to search for a patient using the County Case ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a Notification ID + Given I have a patient + And the patient is a subject of an investigation + And the investigation has a notification status of APPROVED + And patients are available for search + And I would like to search for a patient using the Notification ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a Treatment ID + Given I have a patient + And the patient is a subject of an investigation + And the patient is a subject of a Treatment + And patients are available for search + And I would like to search for a patient using the Treatment ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a Vaccination ID + Given I have a patient + And the patient is vaccinated + And patients are available for search + And I would like to search for a patient using the Vaccination ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with an Investigation ID + Given I have a patient + And the patient is a subject of an investigation + And patients are available for search + And I would like to search for a patient using the Investigation ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with a Lab Report ID + Given I have a patient + And the patient has a Lab Report + And patients are available for search + And I would like to search for a patient using the Lab Report ID + When I search for patients + Then the patient is in the search results + And there is only one patient search result + + Scenario: I can find a patient with an Accession number + Given I have a patient + And the patient has a Lab Report + And the lab report has an Accession number of "3034112" + And patients are available for search + And I would like to search for a patient using the Accession number + When I search for patients + Then the patient is in the search results + And there is only one patient search result diff --git a/apps/modernization-api/src/test/resources/features/search/investigation/InvestigationSearch.feature b/apps/modernization-api/src/test/resources/features/search/investigation/InvestigationSearch.feature index 9027f5c09c..b14f464643 100644 --- a/apps/modernization-api/src/test/resources/features/search/investigation/InvestigationSearch.feature +++ b/apps/modernization-api/src/test/resources/features/search/investigation/InvestigationSearch.feature @@ -234,9 +234,9 @@ Feature: Investigation search And there is only one investigation search result Scenario: I can find investigations related to Active Bacterial Core Surveillance cases - Given the investigation is related to ABCS Case "1013673" + Given the investigation is related to ABCs Case "1013673" And the investigation is available for search - And I want to find investigations for the ABCS Case "1013673" + And I want to find investigations for the ABCs Case "1013673" When I search for investigations Then the Investigation search results contain the Investigation And there is only one investigation search result diff --git a/apps/modernization-ui/src/apps/search/patient/criteria.ts b/apps/modernization-ui/src/apps/search/patient/criteria.ts index 244e5e6a20..0ef61f2f8e 100644 --- a/apps/modernization-ui/src/apps/search/patient/criteria.ts +++ b/apps/modernization-ui/src/apps/search/patient/criteria.ts @@ -42,7 +42,18 @@ type Identification = { identificationType?: Selectable; }; -type PatientCriteriaEntry = BasicInformation & Address & Contact & RaceEthnicity & Identification; +type EventIds = { + morbidity?: string; + document?: string; + stateCase?: string; + abcCase?: string; + cityCountyCase?: string; + notification?: string; + labReport?: string; + accessionNumber?: string; +}; + +type PatientCriteriaEntry = BasicInformation & Address & Contact & RaceEthnicity & Identification & EventIds; export type { PatientCriteriaEntry, BasicInformation, Identification, RaceEthnicity, Contact }; diff --git a/apps/modernization-ui/src/apps/search/patient/transformer.ts b/apps/modernization-ui/src/apps/search/patient/transformer.ts index 1496dcee93..9ef79d772b 100644 --- a/apps/modernization-ui/src/apps/search/patient/transformer.ts +++ b/apps/modernization-ui/src/apps/search/patient/transformer.ts @@ -13,8 +13,26 @@ const resolveIdentification = (data: PatientCriteriaEntry): IdentificationCriter : undefined; export const transform = (data: PatientCriteriaEntry): PersonFilter => { - const { includeSimilar, lastName, firstName, id, address, city, phoneNumber, email, dateOfBirth, ...remaining } = - data; + const { + includeSimilar, + lastName, + firstName, + id, + address, + city, + phoneNumber, + email, + dateOfBirth, + morbidity, + document, + stateCase, + abcCase, + cityCountyCase, + notification, + labReport, + accessionNumber, + ...remaining + } = data; return { disableSoundex: !includeSimilar, lastName, @@ -24,6 +42,14 @@ export const transform = (data: PatientCriteriaEntry): PersonFilter => { city, phoneNumber, email, + morbidity, + document, + stateCase, + abcCase, + cityCountyCase, + notification, + labReport, + accessionNumber, recordStatus: asValues(remaining.status) as RecordStatus[], gender: asValue(remaining.gender), state: asValue(remaining.state), diff --git a/apps/modernization-ui/src/generated/graphql/schema.ts b/apps/modernization-ui/src/generated/graphql/schema.ts index 8b2b3eccfd..115cc9c2f9 100644 --- a/apps/modernization-ui/src/generated/graphql/schema.ts +++ b/apps/modernization-ui/src/generated/graphql/schema.ts @@ -1652,28 +1652,37 @@ export type PatientVaccinationResults = { }; export type PersonFilter = { + abcCase?: InputMaybe; + accessionNumber?: InputMaybe; address?: InputMaybe; bornOn?: InputMaybe; city?: InputMaybe; + cityCountyCase?: InputMaybe; country?: InputMaybe; dateOfBirth?: InputMaybe; dateOfBirthOperator?: InputMaybe; deceased?: InputMaybe; disableSoundex?: InputMaybe; + document?: InputMaybe; email?: InputMaybe; ethnicity?: InputMaybe; firstName?: InputMaybe; gender?: InputMaybe; id?: InputMaybe; identification?: InputMaybe; + investigation?: InputMaybe; + labReport?: InputMaybe; lastName?: InputMaybe; + morbidity?: InputMaybe; mortalityStatus?: InputMaybe; + notification?: InputMaybe; phoneNumber?: InputMaybe; race?: InputMaybe; recordStatus: Array; state?: InputMaybe; - treatmentId?: InputMaybe; - vaccinationId?: InputMaybe; + stateCase?: InputMaybe; + treatment?: InputMaybe; + vaccination?: InputMaybe; zip?: InputMaybe; }; @@ -3453,8 +3462,8 @@ export function useAddressTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptio const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(AddressTypesDocument, options); } -export function useAddressTypesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useAddressTypesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(AddressTypesDocument, options); } export type AddressTypesQueryHookResult = ReturnType; @@ -3493,8 +3502,8 @@ export function useAddressUsesLazyQuery(baseOptions?: Apollo.LazyQueryHookOption const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(AddressUsesDocument, options); } -export function useAddressUsesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useAddressUsesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(AddressUsesDocument, options); } export type AddressUsesQueryHookResult = ReturnType; @@ -3533,8 +3542,8 @@ export function useAssigningAuthoritiesLazyQuery(baseOptions?: Apollo.LazyQueryH const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(AssigningAuthoritiesDocument, options); } -export function useAssigningAuthoritiesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useAssigningAuthoritiesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(AssigningAuthoritiesDocument, options); } export type AssigningAuthoritiesQueryHookResult = ReturnType; @@ -3575,8 +3584,8 @@ export function useCountiesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions(CountiesDocument, options); } -export function useCountiesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useCountiesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(CountiesDocument, options); } export type CountiesQueryHookResult = ReturnType; @@ -3615,8 +3624,8 @@ export function useCountriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions< const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(CountriesDocument, options); } -export function useCountriesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useCountriesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(CountriesDocument, options); } export type CountriesQueryHookResult = ReturnType; @@ -3655,8 +3664,8 @@ export function useDegreesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions(DegreesDocument, options); } -export function useDegreesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useDegreesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(DegreesDocument, options); } export type DegreesQueryHookResult = ReturnType; @@ -3695,8 +3704,8 @@ export function useDetailedEthnicitiesLazyQuery(baseOptions?: Apollo.LazyQueryHo const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(DetailedEthnicitiesDocument, options); } -export function useDetailedEthnicitiesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useDetailedEthnicitiesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(DetailedEthnicitiesDocument, options); } export type DetailedEthnicitiesQueryHookResult = ReturnType; @@ -3737,8 +3746,8 @@ export function useDetailedRacesLazyQuery(baseOptions?: Apollo.LazyQueryHookOpti const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(DetailedRacesDocument, options); } -export function useDetailedRacesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useDetailedRacesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(DetailedRacesDocument, options); } export type DetailedRacesQueryHookResult = ReturnType; @@ -3777,8 +3786,8 @@ export function useEducationLevelsLazyQuery(baseOptions?: Apollo.LazyQueryHookOp const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(EducationLevelsDocument, options); } -export function useEducationLevelsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useEducationLevelsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(EducationLevelsDocument, options); } export type EducationLevelsQueryHookResult = ReturnType; @@ -3817,8 +3826,8 @@ export function useEthnicGroupsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptio const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(EthnicGroupsDocument, options); } -export function useEthnicGroupsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useEthnicGroupsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(EthnicGroupsDocument, options); } export type EthnicGroupsQueryHookResult = ReturnType; @@ -3857,8 +3866,8 @@ export function useEthnicityUnknownReasonsLazyQuery(baseOptions?: Apollo.LazyQue const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(EthnicityUnknownReasonsDocument, options); } -export function useEthnicityUnknownReasonsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useEthnicityUnknownReasonsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(EthnicityUnknownReasonsDocument, options); } export type EthnicityUnknownReasonsQueryHookResult = ReturnType; @@ -3898,8 +3907,8 @@ export function useFindAllConditionCodesLazyQuery(baseOptions?: Apollo.LazyQuery const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllConditionCodesDocument, options); } -export function useFindAllConditionCodesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllConditionCodesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllConditionCodesDocument, options); } export type FindAllConditionCodesQueryHookResult = ReturnType; @@ -3944,8 +3953,8 @@ export function useFindAllEthnicityValuesLazyQuery(baseOptions?: Apollo.LazyQuer const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllEthnicityValuesDocument, options); } -export function useFindAllEthnicityValuesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllEthnicityValuesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllEthnicityValuesDocument, options); } export type FindAllEthnicityValuesQueryHookResult = ReturnType; @@ -4004,8 +4013,8 @@ export function useFindAllJurisdictionsLazyQuery(baseOptions?: Apollo.LazyQueryH const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllJurisdictionsDocument, options); } -export function useFindAllJurisdictionsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllJurisdictionsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllJurisdictionsDocument, options); } export type FindAllJurisdictionsQueryHookResult = ReturnType; @@ -4051,8 +4060,8 @@ export function useFindAllOutbreaksLazyQuery(baseOptions?: Apollo.LazyQueryHookO const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllOutbreaksDocument, options); } -export function useFindAllOutbreaksSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllOutbreaksSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllOutbreaksDocument, options); } export type FindAllOutbreaksQueryHookResult = ReturnType; @@ -4097,8 +4106,8 @@ export function useFindAllPatientIdentificationTypesLazyQuery(baseOptions?: Apol const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllPatientIdentificationTypesDocument, options); } -export function useFindAllPatientIdentificationTypesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllPatientIdentificationTypesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllPatientIdentificationTypesDocument, options); } export type FindAllPatientIdentificationTypesQueryHookResult = ReturnType; @@ -4143,8 +4152,8 @@ export function useFindAllProgramAreasLazyQuery(baseOptions?: Apollo.LazyQueryHo const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllProgramAreasDocument, options); } -export function useFindAllProgramAreasSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllProgramAreasSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllProgramAreasDocument, options); } export type FindAllProgramAreasQueryHookResult = ReturnType; @@ -4189,8 +4198,8 @@ export function useFindAllRaceValuesLazyQuery(baseOptions?: Apollo.LazyQueryHook const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllRaceValuesDocument, options); } -export function useFindAllRaceValuesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllRaceValuesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllRaceValuesDocument, options); } export type FindAllRaceValuesQueryHookResult = ReturnType; @@ -4236,8 +4245,8 @@ export function useFindAllUsersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptio const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindAllUsersDocument, options); } -export function useFindAllUsersSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindAllUsersSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindAllUsersDocument, options); } export type FindAllUsersQueryHookResult = ReturnType; @@ -4299,8 +4308,8 @@ export function useFindContactsNamedByPatientLazyQuery(baseOptions?: Apollo.Lazy const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindContactsNamedByPatientDocument, options); } -export function useFindContactsNamedByPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindContactsNamedByPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindContactsNamedByPatientDocument, options); } export type FindContactsNamedByPatientQueryHookResult = ReturnType; @@ -4339,8 +4348,8 @@ export function useFindDistinctCodedResultsLazyQuery(baseOptions?: Apollo.LazyQu const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindDistinctCodedResultsDocument, options); } -export function useFindDistinctCodedResultsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindDistinctCodedResultsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindDistinctCodedResultsDocument, options); } export type FindDistinctCodedResultsQueryHookResult = ReturnType; @@ -4379,8 +4388,8 @@ export function useFindDistinctResultedTestLazyQuery(baseOptions?: Apollo.LazyQu const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindDistinctResultedTestDocument, options); } -export function useFindDistinctResultedTestSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindDistinctResultedTestSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindDistinctResultedTestDocument, options); } export type FindDistinctResultedTestQueryHookResult = ReturnType; @@ -4434,8 +4443,8 @@ export function useFindDocumentsForPatientLazyQuery(baseOptions?: Apollo.LazyQue const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindDocumentsForPatientDocument, options); } -export function useFindDocumentsForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindDocumentsForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindDocumentsForPatientDocument, options); } export type FindDocumentsForPatientQueryHookResult = ReturnType; @@ -4499,8 +4508,8 @@ export function useFindDocumentsRequiringReviewForPatientLazyQuery(baseOptions?: const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindDocumentsRequiringReviewForPatientDocument, options); } -export function useFindDocumentsRequiringReviewForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindDocumentsRequiringReviewForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindDocumentsRequiringReviewForPatientDocument, options); } export type FindDocumentsRequiringReviewForPatientQueryHookResult = ReturnType; @@ -4564,8 +4573,8 @@ export function useFindInvestigationsByFilterLazyQuery(baseOptions?: Apollo.Lazy const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindInvestigationsByFilterDocument, options); } -export function useFindInvestigationsByFilterSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindInvestigationsByFilterSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindInvestigationsByFilterDocument, options); } export type FindInvestigationsByFilterQueryHookResult = ReturnType; @@ -4624,8 +4633,8 @@ export function useFindInvestigationsForPatientLazyQuery(baseOptions?: Apollo.La const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindInvestigationsForPatientDocument, options); } -export function useFindInvestigationsForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindInvestigationsForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindInvestigationsForPatientDocument, options); } export type FindInvestigationsForPatientQueryHookResult = ReturnType; @@ -4707,8 +4716,8 @@ export function useFindLabReportsByFilterLazyQuery(baseOptions?: Apollo.LazyQuer const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindLabReportsByFilterDocument, options); } -export function useFindLabReportsByFilterSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindLabReportsByFilterSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindLabReportsByFilterDocument, options); } export type FindLabReportsByFilterQueryHookResult = ReturnType; @@ -4779,8 +4788,8 @@ export function useFindLabReportsForPatientLazyQuery(baseOptions?: Apollo.LazyQu const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindLabReportsForPatientDocument, options); } -export function useFindLabReportsForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindLabReportsForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindLabReportsForPatientDocument, options); } export type FindLabReportsForPatientQueryHookResult = ReturnType; @@ -4843,8 +4852,8 @@ export function useFindMorbidityReportsForPatientLazyQuery(baseOptions?: Apollo. const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindMorbidityReportsForPatientDocument, options); } -export function useFindMorbidityReportsForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindMorbidityReportsForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindMorbidityReportsForPatientDocument, options); } export type FindMorbidityReportsForPatientQueryHookResult = ReturnType; @@ -4906,8 +4915,8 @@ export function useFindPatientNamedByContactLazyQuery(baseOptions?: Apollo.LazyQ const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindPatientNamedByContactDocument, options); } -export function useFindPatientNamedByContactSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindPatientNamedByContactSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindPatientNamedByContactDocument, options); } export type FindPatientNamedByContactQueryHookResult = ReturnType; @@ -5261,8 +5270,8 @@ export function useFindPatientProfileLazyQuery(baseOptions?: Apollo.LazyQueryHoo const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindPatientProfileDocument, options); } -export function useFindPatientProfileSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindPatientProfileSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindPatientProfileDocument, options); } export type FindPatientProfileQueryHookResult = ReturnType; @@ -5348,8 +5357,8 @@ export function useFindPatientsByFilterLazyQuery(baseOptions?: Apollo.LazyQueryH const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindPatientsByFilterDocument, options); } -export function useFindPatientsByFilterSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindPatientsByFilterSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindPatientsByFilterDocument, options); } export type FindPatientsByFilterQueryHookResult = ReturnType; @@ -5403,8 +5412,8 @@ export function useFindTreatmentsForPatientLazyQuery(baseOptions?: Apollo.LazyQu const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindTreatmentsForPatientDocument, options); } -export function useFindTreatmentsForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindTreatmentsForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindTreatmentsForPatientDocument, options); } export type FindTreatmentsForPatientQueryHookResult = ReturnType; @@ -5458,8 +5467,8 @@ export function useFindVaccinationsForPatientLazyQuery(baseOptions?: Apollo.Lazy const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(FindVaccinationsForPatientDocument, options); } -export function useFindVaccinationsForPatientSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useFindVaccinationsForPatientSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(FindVaccinationsForPatientDocument, options); } export type FindVaccinationsForPatientQueryHookResult = ReturnType; @@ -5498,8 +5507,8 @@ export function useGenderUnknownReasonsLazyQuery(baseOptions?: Apollo.LazyQueryH const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GenderUnknownReasonsDocument, options); } -export function useGenderUnknownReasonsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useGenderUnknownReasonsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(GenderUnknownReasonsDocument, options); } export type GenderUnknownReasonsQueryHookResult = ReturnType; @@ -5538,8 +5547,8 @@ export function useGendersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions(GendersDocument, options); } -export function useGendersSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useGendersSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(GendersDocument, options); } export type GendersQueryHookResult = ReturnType; @@ -5578,8 +5587,8 @@ export function useIdentificationTypesLazyQuery(baseOptions?: Apollo.LazyQueryHo const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(IdentificationTypesDocument, options); } -export function useIdentificationTypesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useIdentificationTypesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(IdentificationTypesDocument, options); } export type IdentificationTypesQueryHookResult = ReturnType; @@ -5618,8 +5627,8 @@ export function useMaritalStatusesLazyQuery(baseOptions?: Apollo.LazyQueryHookOp const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(MaritalStatusesDocument, options); } -export function useMaritalStatusesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useMaritalStatusesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(MaritalStatusesDocument, options); } export type MaritalStatusesQueryHookResult = ReturnType; @@ -5658,8 +5667,8 @@ export function useNameTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions< const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(NameTypesDocument, options); } -export function useNameTypesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useNameTypesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(NameTypesDocument, options); } export type NameTypesQueryHookResult = ReturnType; @@ -5698,8 +5707,8 @@ export function usePhoneTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(PhoneTypesDocument, options); } -export function usePhoneTypesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function usePhoneTypesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(PhoneTypesDocument, options); } export type PhoneTypesQueryHookResult = ReturnType; @@ -5738,8 +5747,8 @@ export function usePhoneUsesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions< const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(PhoneUsesDocument, options); } -export function usePhoneUsesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function usePhoneUsesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(PhoneUsesDocument, options); } export type PhoneUsesQueryHookResult = ReturnType; @@ -5778,8 +5787,8 @@ export function usePreferredGendersLazyQuery(baseOptions?: Apollo.LazyQueryHookO const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(PreferredGendersDocument, options); } -export function usePreferredGendersSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function usePreferredGendersSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(PreferredGendersDocument, options); } export type PreferredGendersQueryHookResult = ReturnType; @@ -5818,8 +5827,8 @@ export function usePrefixesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions

(PrefixesDocument, options); } -export function usePrefixesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function usePrefixesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(PrefixesDocument, options); } export type PrefixesQueryHookResult = ReturnType; @@ -5858,8 +5867,8 @@ export function usePrimaryLanguagesLazyQuery(baseOptions?: Apollo.LazyQueryHookO const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(PrimaryLanguagesDocument, options); } -export function usePrimaryLanguagesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function usePrimaryLanguagesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(PrimaryLanguagesDocument, options); } export type PrimaryLanguagesQueryHookResult = ReturnType; @@ -5898,8 +5907,8 @@ export function usePrimaryOccupationsLazyQuery(baseOptions?: Apollo.LazyQueryHoo const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(PrimaryOccupationsDocument, options); } -export function usePrimaryOccupationsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function usePrimaryOccupationsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(PrimaryOccupationsDocument, options); } export type PrimaryOccupationsQueryHookResult = ReturnType; @@ -5938,8 +5947,8 @@ export function useRaceCategoriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOpt const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(RaceCategoriesDocument, options); } -export function useRaceCategoriesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useRaceCategoriesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(RaceCategoriesDocument, options); } export type RaceCategoriesQueryHookResult = ReturnType; @@ -5979,8 +5988,8 @@ export function useStatesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions(StatesDocument, options); } -export function useStatesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useStatesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(StatesDocument, options); } export type StatesQueryHookResult = ReturnType; @@ -6019,8 +6028,8 @@ export function useSuffixesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions(SuffixesDocument, options); } -export function useSuffixesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} +export function useSuffixesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} return Apollo.useSuspenseQuery(SuffixesDocument, options); } export type SuffixesQueryHookResult = ReturnType; diff --git a/apps/modernization-ui/src/generated/index.ts b/apps/modernization-ui/src/generated/index.ts index 9a04a0ed54..093ffe937c 100644 --- a/apps/modernization-ui/src/generated/index.ts +++ b/apps/modernization-ui/src/generated/index.ts @@ -11,26 +11,23 @@ export type { AddressDemographic } from './models/AddressDemographic'; export type { Administrative } from './models/Administrative'; export type { BirthDemographic } from './models/BirthDemographic'; export type { ConceptOptionsResponse } from './models/ConceptOptionsResponse'; -export type { Create } from './models/Create'; export type { CreatedPatient } from './models/CreatedPatient'; -export type { Edit } from './models/Edit'; export type { EncryptionResponse } from './models/EncryptionResponse'; +export type { EthnicityDemographic } from './models/EthnicityDemographic'; export type { ExistingRaceCategory } from './models/ExistingRaceCategory'; export type { GenderDemographic } from './models/GenderDemographic'; +export type { GeneralInformationDemographic } from './models/GeneralInformationDemographic'; export type { Identification } from './models/Identification'; -export type { Library } from './models/Library'; export type { LoginRequest } from './models/LoginRequest'; export type { LoginResponse } from './models/LoginResponse'; -export type { Management } from './models/Management'; export type { Me } from './models/Me'; +export type { MortalityDemographic } from './models/MortalityDemographic'; +export type { Name } from './models/Name'; export type { NameDemographic } from './models/NameDemographic'; export type { NewPatient } from './models/NewPatient'; export type { Option } from './models/Option'; -export type { Page } from './models/Page'; export type { Phone } from './models/Phone'; export type { Race } from './models/Race'; -export type { Table } from './models/Table'; -export type { View } from './models/View'; export { CodedResultOptionsService } from './services/CodedResultOptionsService'; export { ConceptOptionsService } from './services/ConceptOptionsService'; diff --git a/apps/modernization-ui/src/generated/models/CreatedPatient.ts b/apps/modernization-ui/src/generated/models/CreatedPatient.ts index 4c488153bf..03739ee974 100644 --- a/apps/modernization-ui/src/generated/models/CreatedPatient.ts +++ b/apps/modernization-ui/src/generated/models/CreatedPatient.ts @@ -2,9 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Name } from './Name'; export type CreatedPatient = { id: number; shortId: number; local: string; + name?: Name; }; diff --git a/apps/modernization-ui/src/generated/models/Edit.ts b/apps/modernization-ui/src/generated/models/Edit.ts deleted file mode 100644 index d26812055b..0000000000 --- a/apps/modernization-ui/src/generated/models/Edit.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Edit = { - enabled?: boolean; -}; - diff --git a/apps/modernization-ui/src/generated/models/EthnicityDemographic.ts b/apps/modernization-ui/src/generated/models/EthnicityDemographic.ts new file mode 100644 index 0000000000..33c9b38a00 --- /dev/null +++ b/apps/modernization-ui/src/generated/models/EthnicityDemographic.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type EthnicityDemographic = { + asOf?: string; + ethnicGroup?: string; + unknownReason?: string; + detailed?: Array; +}; + diff --git a/apps/modernization-ui/src/generated/models/GeneralInformationDemographic.ts b/apps/modernization-ui/src/generated/models/GeneralInformationDemographic.ts new file mode 100644 index 0000000000..a803848222 --- /dev/null +++ b/apps/modernization-ui/src/generated/models/GeneralInformationDemographic.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GeneralInformationDemographic = { + asOf?: string; + maritalStatus?: string; + maternalMaidenName?: string; + adultsInResidence?: number; + childrenInResidence?: number; + primaryOccupation?: string; + educationLevel?: string; + primaryLanguage?: string; + speaksEnglish?: string; + stateHIVCase?: string; +}; + diff --git a/apps/modernization-ui/src/generated/models/Library.ts b/apps/modernization-ui/src/generated/models/Library.ts deleted file mode 100644 index 1034de6d86..0000000000 --- a/apps/modernization-ui/src/generated/models/Library.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Library = { - enabled?: boolean; -}; - diff --git a/apps/modernization-ui/src/generated/models/Management.ts b/apps/modernization-ui/src/generated/models/Management.ts deleted file mode 100644 index f4c471806e..0000000000 --- a/apps/modernization-ui/src/generated/models/Management.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Create } from './Create'; -import type { Edit } from './Edit'; -export type Management = { - create?: Create; - edit?: Edit; -}; - diff --git a/apps/modernization-ui/src/generated/models/MortalityDemographic.ts b/apps/modernization-ui/src/generated/models/MortalityDemographic.ts new file mode 100644 index 0000000000..04527e460f --- /dev/null +++ b/apps/modernization-ui/src/generated/models/MortalityDemographic.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type MortalityDemographic = { + asOf?: string; + deceased?: string; + deceasedOn?: string; + city?: string; + state?: string; + county?: string; + country?: string; +}; + diff --git a/apps/modernization-ui/src/generated/models/Create.ts b/apps/modernization-ui/src/generated/models/Name.ts similarity index 69% rename from apps/modernization-ui/src/generated/models/Create.ts rename to apps/modernization-ui/src/generated/models/Name.ts index 4b4fe66439..d4b2a84512 100644 --- a/apps/modernization-ui/src/generated/models/Create.ts +++ b/apps/modernization-ui/src/generated/models/Name.ts @@ -2,7 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type Create = { - enabled?: boolean; +export type Name = { + first?: string; + last?: string; }; diff --git a/apps/modernization-ui/src/generated/models/NewPatient.ts b/apps/modernization-ui/src/generated/models/NewPatient.ts index 65df870565..cdbb54cad3 100644 --- a/apps/modernization-ui/src/generated/models/NewPatient.ts +++ b/apps/modernization-ui/src/generated/models/NewPatient.ts @@ -5,8 +5,11 @@ import type { AddressDemographic } from './AddressDemographic'; import type { Administrative } from './Administrative'; import type { BirthDemographic } from './BirthDemographic'; +import type { EthnicityDemographic } from './EthnicityDemographic'; import type { GenderDemographic } from './GenderDemographic'; +import type { GeneralInformationDemographic } from './GeneralInformationDemographic'; import type { Identification } from './Identification'; +import type { MortalityDemographic } from './MortalityDemographic'; import type { NameDemographic } from './NameDemographic'; import type { Phone } from './Phone'; import type { Race } from './Race'; @@ -14,6 +17,9 @@ export type NewPatient = { administrative?: Administrative; birth?: BirthDemographic; gender?: GenderDemographic; + ethnicity?: EthnicityDemographic; + mortality?: MortalityDemographic; + general?: GeneralInformationDemographic; names?: Array; addresses?: Array; phoneEmails?: Array; diff --git a/apps/modernization-ui/src/generated/models/Page.ts b/apps/modernization-ui/src/generated/models/Page.ts deleted file mode 100644 index 83d7f5571b..0000000000 --- a/apps/modernization-ui/src/generated/models/Page.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Library } from './Library'; -import type { Management } from './Management'; -export type Page = { - library?: Library; - management?: Management; -}; - diff --git a/apps/modernization-ui/src/generated/models/Table.ts b/apps/modernization-ui/src/generated/models/Table.ts deleted file mode 100644 index e2c4553994..0000000000 --- a/apps/modernization-ui/src/generated/models/Table.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Table = { - enabled?: boolean; -}; - diff --git a/apps/modernization-ui/src/generated/models/View.ts b/apps/modernization-ui/src/generated/models/View.ts deleted file mode 100644 index d6349795d0..0000000000 --- a/apps/modernization-ui/src/generated/models/View.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Table } from './Table'; -export type View = { - enabled?: boolean; - table?: Table; -}; - diff --git a/apps/modernization-ui/src/generated/schema.graphqls b/apps/modernization-ui/src/generated/schema.graphqls index c95264f949..5cccf1a9b3 100644 --- a/apps/modernization-ui/src/generated/schema.graphqls +++ b/apps/modernization-ui/src/generated/schema.graphqls @@ -1134,8 +1134,17 @@ input PersonFilter { zip: String mortalityStatus: String ethnicity: String - vaccinationId: String - treatmentId: String + vaccination: String + morbidity: String + document: String + stateCase: String + abcCase: String + cityCountyCase: String + notification: String + treatment: String + investigation: String + labReport: String + accessionNumber: String disableSoundex: Boolean recordStatus: [RecordStatus!]! } diff --git a/cdc-sandbox/nifi/nifi_conf/conf/flow.xml.gz b/cdc-sandbox/nifi/nifi_conf/conf/flow.xml.gz index 747c16e3f4..0dd3842d7f 100644 Binary files a/cdc-sandbox/nifi/nifi_conf/conf/flow.xml.gz and b/cdc-sandbox/nifi/nifi_conf/conf/flow.xml.gz differ