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

FHIR Create R4 Questionnaire API #541

Closed
wants to merge 38 commits into from

Conversation

icrc-loliveira
Copy link

@icrc-loliveira icrc-loliveira commented Jun 6, 2024

Description of what I changed

Create R4 Questionnaire API

The Questionnaire will be converted from an org.openmrs.Form, for that, the form must have a org.openmrs.FormResource with a name equal to FHIR Questionnaire where the value is a JSON that represents the Questionnaire.

If a specific Questionnaire is request by id, uuid, or name and doesn't have a FormResource with a name equal to FHIR Questionnaire the following error message is shown:

The Openmrs Form doesn't contain an FHIR Questionnaire

If a request for all Questionnaires is made, only Forms with a FormResource with a name equal to FHIR Questionnaire are returned.

Issue I worked on

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

@icrc-loliveira icrc-loliveira changed the title 499631 499631 FHIR Create R4 Questionnaire API Jun 6, 2024
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 81.60920% with 16 lines in your changes missing coverage. Please review.

Project coverage is 77.93%. Comparing base (c7f2ec2) to head (617d5c6).
Report is 6 commits behind head on master.

Files Patch % Lines
...roviders/r4/QuestionnaireFhirResourceProvider.java 61.54% 5 Missing ⚠️
...r2/api/search/param/QuestionnaireSearchParams.java 60.00% 3 Missing and 1 partial ⚠️
.../translators/impl/QuestionnaireTranslatorImpl.java 55.56% 4 Missing ⚠️
...e/fhir2/api/impl/FhirQuestionnaireServiceImpl.java 89.47% 2 Missing ⚠️
...e/fhir2/api/dao/impl/FhirQuestionnaireDaoImpl.java 97.22% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #541      +/-   ##
============================================
+ Coverage     77.84%   77.93%   +0.08%     
- Complexity     2683     2741      +58     
============================================
  Files           239      244       +5     
  Lines          7452     7593     +141     
  Branches        901      918      +17     
============================================
+ Hits           5801     5917     +116     
- Misses         1115     1129      +14     
- Partials        536      547      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@icrc-loliveira icrc-loliveira changed the title 499631 FHIR Create R4 Questionnaire API FHIR Create R4 Questionnaire API Jul 16, 2024
@icrc-loliveira icrc-loliveira marked this pull request as ready for review July 17, 2024 14:55
@icrc-loliveira icrc-loliveira requested a review from ibacher July 17, 2024 14:55
@ibacher
Copy link
Member

ibacher commented Jul 17, 2024

For right now, this isn't going to be accepted in to the FHIR2 module. However, FHIR resources can be defined in custom modules that rely on the FHIR2 module. Here's an example.

The rationale for relegating this is that forms are always specific to a form engine implementation, but OpenMRS Core (and hence the FHIR2 module) are agnostic about the form engine implementation.

@ibacher ibacher closed this Jul 17, 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
Development

Successfully merging this pull request may close these issues.

2 participants