Skip to content

Commit

Permalink
Fix family name search, adjusted phone search for tefca-viewer extra
Browse files Browse the repository at this point in the history
params, enabled patient=ref search parameter, cleanup mapping logging
  • Loading branch information
keithboone committed Aug 18, 2024
1 parent 8f814dd commit 3096b84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/main/java/gov/cdc/izgw/v2tofhir/utils/IzQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.hl7.fhir.r4.model.Patient;
import ca.uhn.fhir.rest.param.DateParam;
import ca.uhn.fhir.rest.param.NumberParam;
import ca.uhn.fhir.rest.param.ReferenceParam;
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.v251.datatype.CX;
Expand Down Expand Up @@ -122,7 +123,13 @@ public void addParameter( // NOSONAR: Giant switch is acceptable
case COUNT:
setCount(param);
break;


case Immunization.SP_PATIENT:
ReferenceParam refParam = new ReferenceParam();
refParam.setValueAsQueryToken(null, Immunization.SP_PATIENT, null, param);
String ident = FhirIdCodec.decode(refParam.getIdPart());
setPatientList(fhirParamName, ident);
break;
case PATIENT_LIST: // QPD-3 PatientList (can repeat)
setPatientList(fhirParamName, param);
break;
Expand Down Expand Up @@ -330,7 +337,7 @@ private void setPatientBirthDate(String fhirParamName, String param) throws HL7E
}

private void setPatientFamilyName(String param) throws HL7Exception{
if (!getName().isEmpty()) {
if (!getName().getFamilyName().isEmpty()) {
throw new IllegalArgumentException(IzQuery.CANNOT_REPEAT + param);
}
getName().getFamilyName().getSurname().setValue(param);
Expand Down Expand Up @@ -384,6 +391,7 @@ private void setPatientNameSuffix(String param) throws HL7Exception{
private void setPatientPhone(String param) throws HL7Exception{
TokenParam token;
token = new TokenParam();
param = param.split(",")[0]; // Take the first value provided
token.setValueAsQueryToken(QBPUtils.R4, PATIENT_HOMEPHONE, null, param);
if (!getTelephone().isEmpty()) {
throw new IllegalArgumentException(IzQuery.CANNOT_REPEAT + param);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/gov/cdc/izgw/v2tofhir/utils/Mapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@ public static String getDisplay(String code, String table) {
Map<String, Coding> cm = codingMaps.get(system);
if (cm == null) {
if (!codingMaps.containsKey(system)) {
// Report this error once during an application session.
warn("Unknown code system: {}", table);
log.debug("Unknown code system: {}", table);
codingMaps.put(system, null);
}
return null;
Expand Down

0 comments on commit 3096b84

Please sign in to comment.