Skip to content

Commit

Permalink
#205: Improve records in issuer table if more issuer information is a…
Browse files Browse the repository at this point in the history
…vailable
  • Loading branch information
gunterze committed Jul 11, 2016
1 parent f2264e9 commit 58b2266
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,16 @@ private Patient updatePatient(StoreContext ctx, Patient pat) {

updateInfo.log(session, pat, attrs);
pat = em.find(Patient.class, pat.getPk());
IDWithIssuer idWithIssuer = IDWithIssuer.pidOf(attrs);
Issuer issuer = idWithIssuer.getIssuer();
if (issuer != null) {
PatientID patientID = pat.getPatientID();
IssuerEntity issuerEntity = patientID.getIssuer();
if (issuerEntity == null)
patientID.setIssuer(issuerService.mergeOrCreate(issuer));
else
issuerEntity.getIssuer().merge(issuer);
}
pat.setAttributes(attrs, filter, arcDev.getFuzzyStr());
return pat;
}
Expand Down

0 comments on commit 58b2266

Please sign in to comment.