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

5738: Skip alternate handling if already handled by previous step #5971

Merged

Conversation

stefan-lindstrom
Copy link
Contributor

Hi,

first time through the code trying to fix an issue, so I hope I haven't violated too many architectural rules. :)

We saw this problem when using extensions on datatypes (using data-absent-reason, with code masked and we had an object with both a primitive and an array-property with masked values. We got this output (example from practitioner):

{
    "resourceType": "Practitioner",
    "id": "1",
    "name": [{
           "_family": {
                    "extension": [{
                            "url": "http:https://hl7.org/fhir/StructureDefinition/data-absent-reason",
                            "valueString": "masked"
                        }
                    ]
                }
           } ,
            "given": [null],
            "_given": [{
                    "extension": [{
                            "url": "http:https://hl7.org/fhir/StructureDefinition/data-absent-reason",
                            "valueString": "masked"
                        }
                    ]
                }
            ],
	    }
	]
}

My understanding is that when the object is normally handled, the parser counts alternateNamesSeen, and alternateNames Handled, and when seen > handled, a second pass is done. But instead of only doing un-handled, the second pass will go over all alternates including non-primitive ones where the alternate json.-type need not be an object but could be an array for (any non-primitive property).

Som y idea is to check, and only do the secondary handling if the alternate property in an object does not have a corresponding "real" property.

@stefan-lindstrom
Copy link
Contributor Author

Tagging @jamesagnew

Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.45%. Comparing base (497b9f2) to head (bef011d).
Report is 74 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5971      +/-   ##
============================================
+ Coverage     83.39%   83.45%   +0.05%     
- Complexity    26927    27105     +178     
============================================
  Files          1681     1692      +11     
  Lines        103965   104631     +666     
  Branches      13189    13253      +64     
============================================
+ Hits          86702    87315     +613     
- Misses        11613    11648      +35     
- Partials       5650     5668      +18     

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

@jamesagnew
Copy link
Collaborator

Fixes #5738

Copy link
Collaborator

@jamesagnew jamesagnew 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 the contribution!

@stefan-lindstrom
Copy link
Contributor Author

Thanks for the contribution!

HAPI to help. (Sorry, I'll see my self out). Is it OK to merge (once I managed to sort out authorization)?

@jamesagnew jamesagnew merged commit 4ac65da into hapifhir:master May 28, 2024
63 of 65 checks passed
@jamesagnew
Copy link
Collaborator

Yup, I've merged. Don't worry about the 2 failed CI checks.. Those fail on external contributions because of some permission issue we haven't figured out yet. Thanks again!

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.

None yet

2 participants