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

Identifier Token search #683

Closed
shmightworks opened this issue May 7, 2024 · 6 comments
Closed

Identifier Token search #683

shmightworks opened this issue May 7, 2024 · 6 comments

Comments

@shmightworks
Copy link

I've just spun up a fresh jpa starter server.

POSTed a simple patient:
{
"resourceType": "Patient",
"identifier": [{
"use": "official",
"type": {
"coding": [{
"system": "http:https://hl7.org/fhir/v2/0203",
"code": "JHN",
"display": "Jurisdictional health number (Canada)"
}
]
},
"system": "https://fhir.infoway-inforoute.ca/NamingSystem/ca-on-patient-hcn",
"value": "0000000018"
}
],
"name": [{
"use": "official",
"family": "Test",
"given": [
"Test"
]
}
],
"gender": "male",
"birthDate": "1990-01-01"
}

I tried to search up this patient with this, but it's not returning the patient:
fhir/Patient?identifier=http%3A%2F%2Fhl7.org%2Ffhir%2Fv2%2F0203%7CJHN%3A0000000018
This doesn't work either:
fhir/Patient?identifier=JHN%3A0000000018
Nor this:
fhir/Patient?identifier=http%3A%2F%2Fhl7.org%2Ffhir%2Fv2%2F0203%7C0000000018
Only this works:
fhir/Patient?identifier=0000000018

This should be a standard FHIR search:
https://hl7.org/fhir/search.html#token

Am I missing some settings or doing the search wrong?

Thanks

@shmightworks
Copy link
Author

Ok, I sorted out the issue, seems the query I was given was doing something weird.
The system and code should be of the same "level", and the query somehow was doing a mix of that.
Need to sort this out with the vendor.

@shmightworks
Copy link
Author

Reading further into the specs' wording, seems like this is an issue afterall.
If I do a search with this:
fhir/Patient?identifier=http%3A%2F%2Fhl7.org%2Ffhir%2Fv2%2F0203%7C0000000018
system is http:https://hl7.org/fhir/v2/0203
code is 0000000018
I should get a result even though the system and code is not in the same "level".

Here's the blurb from hl7:
[parameter]=[system]|[code]: the value of [code] matches a Coding.code or Identifier.value, and the value of [system] matches the system property of the Identifier or Coding

So both the system and the code could belong to either the identifier level or the coding level.

@XcrigX
Copy link
Contributor

XcrigX commented May 14, 2024

When searching on an Identifier, only the Identifier.system and Identifer.value are considered. The Identifier.type.x attributes are not considered. This is not a bug.

You could create a custom search parameter to also search on Identifier.type if desired, but that is not part of the FHIR spec.

@shmightworks
Copy link
Author

Here's where I'm reading it again:

https://www.hl7.org/fhir/search.html#token
[parameter]=[system]|[code]: the value of [code] matches a Coding.code or Identifier.value, and the value of [system] matches the system property of the Identifier or Coding

The part about Coding.code or Coding, isn't it referring to the Identifier.type.Coding.code?

@XcrigX
Copy link
Contributor

XcrigX commented May 14, 2024

No. If you scroll down in that section there is a table that shows you the attributes that will be considered for a given datatype.

However, I see now that you may be able to use the ":of-type" modifier to also include the type information (I didn't know that).
see: https://www.hl7.org/fhir/search.html#modifieroftype

I don't know if HAPI supports ":of-type" though.

@shmightworks
Copy link
Author

Ah, gotcha, thanks.
Putting that blurb on here as well for reference:

Identifier Identifier.system Identifier.value Clients can search by type not system using the :of-type modifier, see below. To search on a CDA II.root - which may appear in either Identifier.system or Identifier.value, use the syntax identifier=|[root],[root]

Just want to make sure whatever my vendor's asking is not of spec.

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

No branches or pull requests

2 participants