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

FM2-492: Create a real integration test for the Observation domain #425

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnsereko
Copy link
Contributor

@jnsereko jnsereko commented Aug 9, 2022

Description of what I changed

  1. A GET request to /openmrs/ws/fhir2/R4/Observation/<uuid> returns a valid FHIR observation.
  2. A POST request to /openmrs/ws/fhir2/R4/Observation with a request body consisting of a JSON observation should create observation.
  3. A PUT request to /openmrs/ws/fhir2/R4/Observation/<uuid> with a request body consisting of a JSON observation should update the details of the observation record.
  4. A DELETE request to /openmrs/ws/fhir2/R4/Observation/<uuid> should void the observation

Issue I worked on

see https://issues.openmrs.org/browse/FM2-492

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

@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #425 (be705d5) into master (0b49a73) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #425   +/-   ##
=========================================
  Coverage     79.97%   79.97%           
  Complexity     2422     2422           
=========================================
  Files           224      224           
  Lines          6565     6565           
  Branches        777      777           
=========================================
  Hits           5250     5250           
  Misses          842      842           
  Partials        473      473           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


public class ObservationDomainTest {

private static final String SERVER_BASE = "http://localhost:8080/openmrs/ws/fhir2/R4";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think this has to be added to the FhirConstants.java or i should create my own class in under this module and add all constants there

Copy link
Contributor Author

@jnsereko jnsereko left a comment

Choose a reason for hiding this comment

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

@dkayiwa @ibacher
I suggest that i add sample data to the docker instance


private static String observationUuid = "34d45fr6-f3a9-4f46-8341-15f0de3d8476";

private static final String OBSERVATION_PATIENT_UUID = "58c57d25-8d39-41ab-8422-108a0c277d98";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does out docker instance come with any sample data. If not, i think it will save us alot of time referencing existing patients than creating new ones each time we need a patient


private static final String OBSERVATION_ENCOUNTER_UUID_1 = "58c57d25-8d39-41ab-8422-108a0c277d98";

private static final String OBSERVATION_ENCOUNTER_UUID_2 = "58c57d25-8d39-41ab-8422-108a0c277d98";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same ad here

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.

1 participant