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

(fix) RESTWS-908 Diagnosis resource should return formNamespace and formPath on core 2.5+ #577

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

suubi-joshua
Copy link

@suubi-joshua suubi-joshua commented May 3, 2023

RESTWS-908 Diagnosis resource should return formNamespace and formPath on core 2.5+
RESTWS-908
I created a new submodule 2.5 and created a diagnosisResource class that extends the DiagnosisResource2_2 class in the 2.2 module. I added the formNamespace properties such that they can be returned.

Issue I worked on

see https://openmrs.atlassian.net/browse/RESTWS-908

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

Copy link

@jona42-ui jona42-ui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First correct the issue link.
I suppose there were db field changes that need to be updated in 2.5+
Cant seem to see the DAOs.

To make it clear i think @ibacher can give details of the database schema changes that were made in Core 2.5+.

Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! A few comments, but I don't think anything major is unexpected here. It might be good if we can expose a combined "formNamespaceAndPath" property (I believe there's a getter and setter for this already), as that is most likely to be useful.

<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>webservices.rest</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

Suggested change
<artifactId>webservices.rest</artifactId>
<artifactId>webservices.rest</artifactId>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be indented correctly locally in my IDE but when i push the changes that specific section is distorted.

pom.xml Outdated
Comment on lines 574 to 576
<modules>
<module>webservices.rest-omod-2.5</module>
</modules>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use the profiles:

Suggested change
<modules>
<module>webservices.rest-omod-2.5</module>
</modules>

webservices.rest-omod-2.5/pom.xml Outdated Show resolved Hide resolved
</plugins>
</build>

</project>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</project>
</project>

*/
@Resource(name = RestConstants.VERSION_1
+ "/patientdiagnoses", supportedClass = Diagnosis.class, supportedOpenmrsVersions = { "2.5.* - 9.*" })
public class DiagnosisResource2_5 extends DiagnosisResource2_2 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also have a change to DiagnosisResource2_2 so that it's only supported up to 2.4.*

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I create another ticket to resolve this?

@suubi-joshua
Copy link
Author

Thanks @ibacher let me work on these changes.

@suubi-joshua
Copy link
Author

Thanks for this! A few comments, but I don't think anything major is unexpected here. It might be good if we can expose a combined "formNamespaceAndPath" property (I believe there's a getter and setter for this already), as that is most likely to be useful.

@ibacher yes there is a getter and setter for the formNamespaceAndPath. I have added the property.

@dkayiwa
Copy link
Member

dkayiwa commented May 8, 2023

Can you also fix the link to the issue?

@suubi-joshua
Copy link
Author

Can you also fix the link to the issue?

THANKS @dkayiwa
I think am not failing to understand this advise? I beg your pardon please

@dkayiwa
Copy link
Member

dkayiwa commented May 8, 2023

Can you also fix the link to the issue?

THANKS @dkayiwa I think am not failing to understand this advise? I beg your pardon please

Are you able to open the jira ticket link that you included at the top of this pull request?

@suubi-joshua
Copy link
Author

Can you also fix the link to the issue?

THANKS @dkayiwa I think am not failing to understand this advise? I beg your pardon please

Are you able to open the jira ticket link that you included at the top of this pull request?
@dkayiwa
Ohhh let me fix that sorry about that.

@suubi-joshua
Copy link
Author

My bad this is way overdue @dkayiwa @ibacher . Made some changes as requested.

@dkayiwa
Copy link
Member

dkayiwa commented Jul 9, 2024

@suubi-joshua did you see the build failures?

@suubi-joshua
Copy link
Author

suubi-joshua commented Jul 9, 2024

@suubi-joshua did you see the build failures?

Seeing them now. let me fix that. The Parent version was pointing at 2.40 I have changed it to point at 2.45

@suubi-joshua
Copy link
Author

suubi-joshua commented Jul 10, 2024

The build should be successful now @dkayiwa . It was successful locally.

@suubi-joshua suubi-joshua changed the title RESTWS-908 Diagnosis resource should return formNamespace and formPath on core 2.5+ (fix) RESTWS-908 Diagnosis resource should return formNamespace and formPath on core 2.5+ Jul 11, 2024
@suubi-joshua suubi-joshua requested a review from ibacher July 11, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants