Skip to content

Commit

Permalink
#467: enhance sorting by author
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Ohr committed Jan 31, 2025
1 parent 1c7c697 commit 9b753ce
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import lombok.Setter;
import lombok.ToString;
import org.hl7.fhir.r4.model.DocumentManifest;
import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.PractitionerRole;

Expand Down Expand Up @@ -110,6 +111,11 @@ private static String getAuthorName(DocumentManifest documentManifest) {
var name = practitioner.getNameFirstRep();
return name.getFamilyElement().getValueNotNull() + name.getGivenAsSingleString();
}
if (author.getResource() instanceof Patient patient) {
if (!patient.hasName()) return null;
var name = patient.getNameFirstRep();
return name.getFamilyElement().getValueNotNull() + name.getGivenAsSingleString();
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import lombok.Setter;
import lombok.ToString;
import org.hl7.fhir.r4.model.DocumentReference;
import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.PractitionerRole;
import org.openehealth.ipf.commons.ihe.fhir.FhirSearchAndSortParameters;
Expand Down Expand Up @@ -137,6 +138,11 @@ private static String getAuthorName(DocumentReference documentReference) {
var name = practitioner.getNameFirstRep();
return name.getFamilyElement().getValueNotNull() + name.getGivenAsSingleString();
}
if (author.getResource() instanceof Patient patient) {
if (!patient.hasName()) return null;
var name = patient.getNameFirstRep();
return name.getFamilyElement().getValueNotNull() + name.getGivenAsSingleString();
}
return null;
}

Expand Down
3 changes: 3 additions & 0 deletions src/site/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
</properties>
<body>
<release version="5.0.0" description="" date="">
<action issue="467" dev="ohr" type="update">
Allow to sort by patient author name in ITI-66 and ITI-67 queries
</action>
<action issue="466" dev="unixoid" type="add">
Early support for Swiss UPI transactions eCH-0213, eCH-0214, eCH-0215.
</action>
Expand Down

0 comments on commit 9b753ce

Please sign in to comment.