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

Configure unique identifier assignment #3075

Merged
merged 55 commits into from
Jun 18, 2024
Merged

Configure unique identifier assignment #3075

merged 55 commits into from
Jun 18, 2024

Conversation

ellykits
Copy link
Collaborator

@ellykits ellykits commented Feb 16, 2024

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes 3048

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Attention: Patch coverage is 36.11111% with 46 lines in your changes missing coverage. Please review.

Project coverage is 28.3%. Comparing base (ac82739) to head (5a98047).
Report is 91 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3075     +/-   ##
=========================================
- Coverage     29.6%   28.3%   -1.3%     
- Complexity     658     720     +62     
=========================================
  Files          239     266     +27     
  Lines        11204   12689   +1485     
  Branches      1948    2244    +296     
=========================================
+ Hits          3323    3600    +277     
- Misses        7447    8614   +1167     
- Partials       434     475     +41     
Flag Coverage Δ
engine 64.8% <68.4%> (-1.4%) ⬇️
geowidget 18.7% <ø> (-28.5%) ⬇️
quest 5.1% <0.0%> (-0.3%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...e/engine/data/local/register/RegisterRepository.kt 70.3% <ø> (+0.1%) ⬆️
...ircore/engine/configuration/QuestionnaireConfig.kt 79.7% <83.3%> (-1.5%) ⬇️
...er/fhircore/engine/data/local/DefaultRepository.kt 63.7% <61.5%> (-4.3%) ⬇️
...e/quest/ui/questionnaire/QuestionnaireViewModel.kt 2.8% <0.0%> (-0.8%) ⬇️

... and 19 files with indirect coverage changes

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@ellykits
Copy link
Collaborator Author

This PR introduces a new configuration for unique ID assignments. Refer to the QuestionnaireConfig docs session to find out more. Here is a sample config:

{
  "uniqueIdAssignment": {
    "linkId": "phn",
    "idFhirPathExpression": "Group.characteristic.where(exclude=false and code.text='phn').first().value.text",
    "readOnly": false,
    "resource": "Group",
    "sortConfigs": [
      {
        "paramName": "_lastUpdated",
        "dataType": "DATE",
        "order": "DESCENDING"
      }
    ],
    "resourceFilterExpression": {
      "conditionalFhirPathExpressions": [
        "Group.active = true and Group.type = 'device' and Group.name = 'Unique IDs'"
      ],
      "matchAll": true
    }
  }
}

@@ -325,3 +326,43 @@ triggerConditions | This defines an array of condition for to be met for the eve
eventResourceId | uniqueId of resource id to be closed | yes | |
eventResources | A list of resources to close(Type of ResourceConfig) | yes | | |


Copy link
Member

Choose a reason for hiding this comment

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

@ellykits do we dictate where in the Patient, Group e.t.c resource is added?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which resources are you referring to here @dubdabasoduba? The resource used to sync unique identifiers? This new configuration (see the sample in the comment) is added to the Questionnaire config.

pld
pld previously requested changes Feb 26, 2024
@@ -325,3 +326,43 @@ triggerConditions | This defines an array of condition for to be met for the eve
eventResourceId | uniqueId of resource id to be closed | yes | |
eventResources | A list of resources to close(Type of ResourceConfig) | yes | | |


## Unique ID assignment

Copy link
Member

Choose a reason for hiding this comment

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

@allan-on can you please add a sub-section here describing

@pld
Copy link
Member

pld commented Feb 26, 2024

@allan-on please add a top level feature for unique ID assignment here, https://docs.opensrp.io/features/app-features, then tag @rowo and me to review it

@ellykits
Copy link
Collaborator Author

@allan-on I will add the remaining tests to improve the coverage during CHT this week.

@pld
Copy link
Member

pld commented Feb 28, 2024

@allan-on I will add the remaining tests to improve the coverage during CHT this week.

can add an issue that refs this pr?

@ellykits
Copy link
Collaborator Author

Sure

@pld pld dismissed their stale review April 17, 2024 18:44

out of date

pld
pld previously approved these changes Apr 30, 2024
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@pld
Copy link
Member

pld commented Jun 3, 2024

Looks like testRetrieveUniqueIdAssignmentResourceShouldReturnAResource is failing there's more coverage needed for retrieveUniqueIdAssignmentResource, along with a couple other functions

@pld pld disabled auto-merge June 18, 2024 18:48
@pld pld merged commit f1567be into main Jun 18, 2024
4 of 5 checks passed
@pld pld deleted the load-opensrp-id branch June 18, 2024 19:26
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.

Add support for use of rules and computed values in Register configs and FAB
4 participants