Skip to content

Commit

Permalink
Resolved profession of patients not saving at person fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Dec 11, 2024
1 parent eccdf7b commit 603e983
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,10 @@ public class Person extends PseudonymizableAdo {
private String qualification;
@Transient
private Set<Profession> professionOfPatient;
@Column(length = CHARACTER_LIMIT_DEFAULT)
@Column
private String professionOfPatientString;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String professionOfPatientOther;

@Column(length = CHARACTER_LIMIT_DEFAULT)
private String otherId;
@Column(length = CHARACTER_LIMIT_DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public void fillInnerFromDto(Person target, PersonDto source) {
target.setNameHealthFacility(source.getNameHealthFacility());
target.setService(source.getService());
target.setQualification(source.getQualification());
target.setProfessionOfPatient(source.getProfessionOfPatient());
target.setBirthdateDD(source.getBirthdateDD());
target.setBirthdateMM(source.getBirthdateMM());
target.setBirthdateYYYY(source.getBirthdateYYYY());
Expand Down Expand Up @@ -218,6 +219,7 @@ public void fillInnerFromAdo(PersonDto target, Person source) {
target.setNameHealthFacility(source.getNameHealthFacility());
target.setService(source.getService());
target.setQualification(source.getQualification());
target.setProfessionOfPatient(source.getProfessionOfPatient());
target.setPresentCondition(source.getPresentCondition());
target.setDeathDate(source.getDeathDate());
target.setDeathPlaceType(source.getDeathPlaceType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ private void setUpLayoutBinding(final BaseEditFragment fragment, final Person re
contentBinding.personDeathDate.initializeDateField(fragment.getFragmentManager());
contentBinding.personBurialDate.initializeDateField(fragment.getFragmentManager());
contentBinding.personResidenceSinceWhenInMonths.addValueChangedListener(field -> handlePersonResidenceSinceWhenInMonths(contentBinding));
contentBinding.setProfessionClass(Profession.class);
}

public static void setUpControlListeners(
Expand Down Expand Up @@ -606,10 +605,6 @@ public void onLayoutBinding(FragmentPersonEditLayoutBinding contentBinding) {
contentBinding.setYesNoClass(YesNo.class);
PersonValidator.initializePersonValidation(contentBinding);

if (disease != null) {
super.hideFieldsForDisease(disease, contentBinding.mainContent, FormType.PERSON_EDIT);
}

contentBinding.setAddressList(getAddresses());
contentBinding.setAddressItemClickCallback(onAddressItemClickListener);
getContentBinding().setAddressBindCallback(this::setLocationFieldVisibilitiesAndAccesses);
Expand All @@ -620,6 +615,11 @@ public void onLayoutBinding(FragmentPersonEditLayoutBinding contentBinding) {
setUpLayoutBinding(this, record, contentBinding);
contentBinding.setAttendedByClass(AttendedBy.class);
contentBinding.setYesNoUnknownClass(YesNoUnknown.class);
contentBinding.setProfessionClass(Profession.class);

if (disease != null) {
super.hideFieldsForDisease(disease, contentBinding.mainContent, FormType.PERSON_EDIT);
}
}

@Override
Expand Down

0 comments on commit 603e983

Please sign in to comment.