Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching from Hibernate mappings to Annotations - Person Address #4270

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

mherman22
Copy link
Contributor

@mherman22 mherman22 commented Mar 13, 2023

Description of what I changed

I changed the Person Address domain's reliance on xml mappings to use JPA annotations. I used annotations like @column, @entity, @table @OneToMany and many others as can be seen in the changes in this pull request.

Issue I worked on

see https://issues.openmrs.org/browse/TRUNK-5928

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.

    No? Unsure? -> configure your IDE, format the code and add the changes with git add . && git commit --amend

  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)

    No? -> write tests and add them to this commit git add . && git commit --amend

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

    No? -> execute above command

  • All new and existing tests passed.

    No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.

  • My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@mherman22
Copy link
Contributor Author

@ibacher @dkayiwa kindly review this pr

@dkayiwa
Copy link
Member

dkayiwa commented Mar 20, 2023

@mherman22 have you tried running openmrs-core with these changes to save person addresses?

@dkayiwa dkayiwa merged commit 282399c into openmrs:master Mar 20, 2023
@mherman22
Copy link
Contributor Author

@mherman22 have you tried running openmrs-core with these changes to save person addresses?

seen i've this late, I have made the deployment via jetty using mvn jetty:run and an interface was brought up that however leads to no UI. My attempt is on how to install the required modules to have the required UI so that i am able to view these changes.

However, i am exploring another avenue of using the SDK but i am not certain that i can watch changes in core.

Any help or pointer @dkayiwa?

@mherman22
Copy link
Contributor Author

This is what i have done to test the changes on this branch;

  • setup refapp 2.13.0 locally using openmrs-sdk.
  • cd into openmrs-core directory and ensure its on branch TRUNK-5928.
  • Then triggered mvn clean install openmrs-sdk:run -DserverId=demo
  • I then created a patient and everything looked fine.
{
    "results": [{
        "uuid": "f2dc257b-9333-4eb3-afb8-da63b689bfe8",
        "display": "10000X - muhereza herman",
        "identifiers": [{
            "uuid": "ec2d85bf-1f27-4e2d-a33a-77bd01c52635",
            "display": "OpenMRS ID = 10000X",
            "links": [{
                "rel": "self",
                "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/patient/f2dc257b-9333-4eb3-afb8-da63b689bfe8/identifier/ec2d85bf-1f27-4e2d-a33a-77bd01c52635",
                "resourceAlias": "identifier"
            }]
        }],
        "person": {
            "uuid": "f2dc257b-9333-4eb3-afb8-da63b689bfe8",
            "display": "muhereza herman",
            "gender": "M",
            "age": 45,
            "birthdate": "1977-11-01T00:00:00.000+0300",
            "birthdateEstimated": true,
            "dead": false,
            "deathDate": null,
            "causeOfDeath": null,
            "preferredName": {
                "uuid": "0f8b52f9-4ad1-4e08-ac93-928cd009ba40",
                "display": "muhereza herman",
                "links": [{
                    "rel": "self",
                    "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/person/f2dc257b-9333-4eb3-afb8-da63b689bfe8/name/0f8b52f9-4ad1-4e08-ac93-928cd009ba40",
                    "resourceAlias": "name"
                }]
            },
            "preferredAddress": {
                "uuid": "11c7ba8b-23c4-4dd0-9b97-12be2fce6b37",
                "display": "nansana, yesu amala",
                "links": [{
                    "rel": "self",
                    "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/person/f2dc257b-9333-4eb3-afb8-da63b689bfe8/address/11c7ba8b-23c4-4dd0-9b97-12be2fce6b37",
                    "resourceAlias": "address"
                }]
            },
            "attributes": [{
                "uuid": "1e625bd9-47f9-4c69-894f-26c6db507d6f",
                "display": "Telephone Number = 0777041946",
                "links": [{
                    "rel": "self",
                    "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/person/f2dc257b-9333-4eb3-afb8-da63b689bfe8/attribute/1e625bd9-47f9-4c69-894f-26c6db507d6f",
                    "resourceAlias": "attribute"
                }]
            }],
            "voided": false,
            "birthtime": null,
            "deathdateEstimated": false,
            "links": [{
                "rel": "self",
                "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/person/f2dc257b-9333-4eb3-afb8-da63b689bfe8",
                "resourceAlias": "person"
            }, {
                "rel": "full",
                "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/person/f2dc257b-9333-4eb3-afb8-da63b689bfe8?v=full",
                "resourceAlias": "person"
            }],
            "resourceVersion": "1.11"
        },
        "voided": false,
        "links": [{
            "rel": "self",
            "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/patient/f2dc257b-9333-4eb3-afb8-da63b689bfe8",
            "resourceAlias": "patient"
        }, {
            "rel": "full",
            "uri": "http:https://localhost:8091/openmrs/ws/rest/v1/patient/f2dc257b-9333-4eb3-afb8-da63b689bfe8?v=full",
            "resourceAlias": "patient"
        }],
        "resourceVersion": "1.8"
    }]
}

/cc: @dkayiwa

@dkayiwa
Copy link
Member

dkayiwa commented Mar 21, 2023

Talk would be the best place for you to ask for help on this.

@mherman22 mherman22 deleted the TRUNK-5928 branch March 24, 2023 13:15
Wandji69 pushed a commit to Wandji69/openmrs-core that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants