Stream: implementers
Topic: valueCodeableConcept under Group.Characteristic DTSU3 Java
Calvin (Aug 15 2019 at 14:42):
Hello,
I am trying to generate a "Group" resource DTSU3 in Java. Everything except a valueCodeableConcept (under Characteristic) is not working for me. I am unable to set the valueCodeableConcept as a part of the characteristic. I am unable to use the GroupCharacteristicComponent.setValue directly.
Any pointers appreciated. Thanks in advance.
Sample Expected Output:
"characteristic": [ { "code": { "coding": [ { "code": "attributed-to" } ] }, "valueCodeableConcept": { "coding": [ { "system": "http://hl7.org/fhir/sid/us-npi", "value": "110001029483" } ] } } ]
What I have so far:
"characteristic": [ { "code": { "coding": [ { "code": "attributed-to" } ] } } ],
What is missing:
"valueCodeableConcept": { "coding": [ { "system": "http://hl7.org/fhir/sid/us-npi", "value": "110001029483" } ] }
My Code:
// set characteristic code CodeableConcept ccgcc1 = new CodeableConcept(); ccgcc1.addCoding().setCodeElement(new CodeType("attributed-to")); Extension e = new Extension(); e.setValue(new StringType("123321")); e.setUrl("http://hl7.org/fhir/sid/us-npi"); // add characteristic code to the groupcharacteristiccomponent GroupCharacteristicComponent gccgrp1 = new GroupCharacteristicComponent(); gccgrp1.setCode(ccgcc1); try { gccgrp1.setValue(e.castToType(new CodeableConcept())); } catch (FHIRFormatError e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (FHIRException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // member references Reference rpt1 = new Reference(); rpt1.setReference("pt1"); GroupMemberComponent gmc1 = new GroupMemberComponent(); gmc1.setEntity(rpt1); Reference rpt2 = new Reference(); rpt2.setReference("pt2"); GroupMemberComponent gmc2 = new GroupMemberComponent(); gmc2.setEntity(rpt2); gmc2.setInactive(true); Group attrgrp1 = new Group(); attrgrp1.setActual(true); attrgrp1.setType(GroupType.PERSON); attrgrp1.addCharacteristic(gccgrp1); attrgrp1.addMember(gmc1); attrgrp1.addMember(gmc2); FhirContext forDstu3 = FhirContext.forDstu3(); return forDstu3.newJsonParser().setPrettyPrint(true).encodeResourceToString(attrgrp1);
Grahame Grieve (Aug 15 2019 at 19:02):
gccgrp1.setValue(e.castToType(new CodeableConcept()));
Why are you using castToType?
Grahame Grieve (Aug 15 2019 at 19:03):
are you getting any exceptions? What happens if you remove the catch?
Calvin (Aug 15 2019 at 19:09):
gccgrp1.setValue(e.castToType(new CodeableConcept()));
Why are you using castToType?
Hello,
I was unable to find a direct way to set the value needed. I just thought it may work. Guess, I am doing something wrong somewhere.
Calvin (Aug 15 2019 at 19:09):
are you getting any exceptions? What happens if you remove the catch?
On doing "gccgrp1.setValue(e);", I get this:
org.hl7.fhir.exceptions.FHIRFormatError: Not the right type for Group.characteristic.value[x]: Extension
Any help is appreciated. Thanks!
Grahame Grieve (Aug 15 2019 at 19:10):
should be just
gccgrp1.setValue(new CodeableConcept());
but then you have to populate some information on the codeable concept or the value will be ignored
Grahame Grieve (Aug 15 2019 at 19:15):
oh - read more carefully. You shouldn't be using an extension at all in that code
Calvin (Aug 15 2019 at 19:31):
Yes, you are correct. My challenge is how do I setup that value in CodeableConcept. I have just been able to set Code part (if you see my original code,
ccgcc1.addCoding().setCodeElement(new CodeType("attributed-to"));
however, I am unable to enter the value (which should come in as valueCodeableConcept.
I know, Extensions are not needed, but, it was a last ditch effort to see if I can try to get that populated. I keep on learning something new every time I am trying to work with Java.
Thanks.
Grahame Grieve (Aug 15 2019 at 19:34):
CodeableConcept cc = new CodeableConcept(); cc.addCoding().setCode("attributed-to").setSystem("http://my-uri"); gccgrp1.setValue(cc);
Calvin (Aug 15 2019 at 19:39):
CodeableConcept cc = new CodeableConcept(); cc.addCoding().setCode("attributed-to").setSystem("http://my-uri"); gccgrp1.setValue(cc);
you beat me to that.
I just did the same
CodeableConcept ccgcc2 = new CodeableConcept(); ccgcc2.addCoding().setSystem("MyURL").setUserData("value", new StringType("123"));
This returns:
"valueCodeableConcept": { "coding": [ { "system": "MyURL" } ] }
Now, what is missing is, how to get that value "123" as a part of this CodeableConcept...
Thanks
Grahame Grieve (Aug 15 2019 at 19:42):
what 'value 123'? There's no value element in a CodeableConcept - what are you trying to achieve?
Calvin (Aug 15 2019 at 19:43):
what 'value 123'? There's no value element in a CodeableConcept - what are you trying to achieve?
I am trying to achieve:
"valueCodeableConcept": { "coding": [ { "system": "http://hl7.org/fhir/sid/us-npi", "value": "110001029483" } ] }
How does one set the value in above example? Thank you.
Grahame Grieve (Aug 15 2019 at 19:47):
there is no value - you are confused between identifier and codeable concept. npi is an identifier thing. But step back further - what are you trying to do? It doesn't make sense to create a group with a characteristic that is 'npi number'?
Calvin (Aug 15 2019 at 20:34):
there is no value - you are confused between identifier and codeable concept. npi is an identifier thing. But step back further - what are you trying to do? It doesn't make sense to create a group with a characteristic that is 'npi number'?
I am trying to create what is called an "Attribution Group" also known as a Patient roster. That is a way to associate patient(s) to a provider/ practitioner as a Group. Hence the need for the NPI value is needed to be setup.
Sample Roster:
{ "resourceType": "Group", "type": "person", "actual": true, "characteristic": [ { "code": { "coding": [ { "code": "attributed-to" } ] }, "valueCodeableConcept": { "coding": [ { "system": "http://hl7.org/fhir/sid/us-npi", "value": "110001029483" } ] } } ], "member": [ { "entity": { "reference": "Patient/4d72ad76-fbc6-4525-be91-7f358f0fea9d" } }, { "entity": { "reference": "Patient/74af8018-f3a1-469c-9bfa-1dfd8a646874" } } ] }
Hope this clarifies.
Grahame Grieve (Aug 15 2019 at 20:38):
The group resource doesn't currently support that. - identifier is not a valid value for a characteristic - which is why the problem. You should create a task (see bottom of any page of the FHIR spec) asking for it to support that. in the meantime, I guess I'd stick with CodeableConcept and use code
instead of value
Calvin (Aug 15 2019 at 20:52):
The group resource doesn't currently support that. - identifier is not a valid value for a characteristic - which is why the problem. You should create a task (see bottom of any page of the FHIR spec) asking for it to support that. in the meantime, I guess I'd stick with CodeableConcept and use
code
instead ofvalue
Wow, this is interesting. I will be also reaching to the source which requested such a data and seek feedback. Thank you again!
Josh Mandel (Aug 16 2019 at 13:11):
I think our best advice for attribution groups (at least mine) is captured at https://github.com/smart-on-fhir/smart-on-fhir.github.io/wiki/Bulk-data:-thoughts-on-attribution-lists-and-groups -- and the CMS Data at the Point of Care pilot team is exploring the approach and Will be able to provide some real world feedback (https://dpc.cms.gov/docs)
Josh Mandel (Aug 16 2019 at 13:11):
@Calvin FYI
Calvin (Aug 16 2019 at 14:01):
I think our best advice for attribution groups (at least mine) is captured at https://github.com/smart-on-fhir/smart-on-fhir.github.io/wiki/Bulk-data:-thoughts-on-attribution-lists-and-groups -- and the CMS Data at the Point of Care pilot team is exploring the approach and Will be able to provide some real world feedback (https://dpc.cms.gov/docs)
Perfect. Will keep an eye. Thanks.
Jon Fulk (Aug 18 2020 at 17:00):
@Calvin We at the CMS Data at the Point of Care project are also running into this issue. We would like to be able to include a practitioner's NPI in the Group.characteristic, but using code
instead of value
still fails validation due to the code system http://hl7.org/fhir/sid/us-npi
being an identifier system and not a terminology. I plan on creating a task as @Grahame Grieve suggested if you have not already done so. Have you had any success since this conversation?
Grahame Grieve (Aug 19 2020 at 02:45):
can you provide an example of what is failing to validate?
Jon Fulk (Aug 19 2020 at 13:15):
@Grahame Grieve Sure! One piece of info that might be helpful is that we are validating with HAPI. The validation failure is happening in an integration test that uses the group we create in this method (this specific line is the one causing the failure): https://github.com/CMSgov/dpc-app/blob/f24b3014db681f6039953c12dc0d4daf0da363b3/dpc-common/src/main/java/gov/cms/dpc/common/utils/SeedProcessor.java#L125.
The goal is to create a resource with a practitioner's NPI inside a CodeableConcept in the Group characteristic, like this:
{
"resourceType": "Group",
"characteristic": [{
"code": {
"coding": {
"code": "attributed-to"
}
},
"value": {
"coding": {
"system": "http://hl7.org/fhir/sid/us-npi",
"code": "1234567890"
}
}
}]
}
The validation failure is that the URI is an Unknown Code System, and we believe it is due to the fact that this URI is not included here: https://github.com/hapifhir/org.hl7.fhir.core/blob/eb23fcc5e45c36f1c2f7bca9aa5b68b1b7aa0810/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java#L774 even though it does appear in the FHIR docs. It seems like this could be because the NPI is an identifier system and not a terminology system, so we're not sure if we are trying to include the NPI in the wrong place or if there is a mistake in the HAPI validator.
Jon Fulk (Aug 20 2020 at 21:17):
@Grahame Grieve When you have a chance to look at the snippets above, I'm most interested in knowing if I should create a task to allow this URI or if I need to be storing the attributed-to NPI differently. Thanks!
Grahame Grieve (Aug 21 2020 at 05:45):
hi
Grahame Grieve (Aug 21 2020 at 05:46):
so looking at this: you'll first get a warning that you don't have system for the code "attributed-to". Then you should get a warning that the system http://hl7.org/fhir/sid/us-npi
is not known to the validator, and indeed, that's correct. http://hl7.org/fhir/sid/us-npi
is not a code system, it's a set of identifiers.
Grahame Grieve (Aug 21 2020 at 05:54):
I'm not exactly sure what it is that you want but I would think something like this:
"resourceType": "Group",
"characteristic": [{
"code": {
"coding": {
"system": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes",
"code": "RESPRSN"
}
},
"valueReference": {
"identifier": {
"system": "http://hl7.org/fhir/sid/us-npi",
"value": "1234567890"
}
}
}]
}
Jon Fulk (Aug 24 2020 at 15:10):
Hi @Grahame Grieve, Thanks for your reply last week! I've been talking it over with the team. We're still on STU3, so we're considering just using the X-Provenance header to store the practitioner NPI instead of a characteristic. Do you have thoughts or opinions on that? Thanks again for taking the time!
Grahame Grieve (Aug 24 2020 at 19:13):
it's hard for me to understand how that approach would be appropriate for the same functional outcome. What are you actually trying to do?
Jon Fulk (Aug 24 2020 at 19:38):
@Grahame Grieve Initially, we were trying to use the Group.characteristic to store the Practitioner's NPI so that we could later get the Practitioner from the Group via this NPI, which is failing validation for the reasons we discussed already. However, we are also including the Practitioner's internal ID in the X-Provenance header, so we could get to the Practitioner from this ID as well instead of using the NPI. The goal is to link the Group to the Practitioner in our database, and it looks like we can't correctly use a characteristic for this until we upgrade to R4 and use thevalueReference
property as you describe above. We're curious whether or not you think using the X-Provenence
header for this instead of a characteristic is still in line with the FHIR spec. By the way, we do intend on upgrading to R4 eventually, but we don't have that work slated yet.
Grahame Grieve (Aug 24 2020 at 19:53):
you're linking this because the Practitioner manages the group?
Jon Fulk (Aug 24 2020 at 19:54):
Grahame Grieve said:
you're linking this because the Practitioner manages the group?
Yes, this Group is the patient roster for that Practitioner.
Jon Fulk (Aug 27 2020 at 19:09):
Jon Fulk said:
Grahame Grieve said:
you're linking this because the Practitioner manages the group?
Yes, this Group is the patient roster for that Practitioner.
Is this an incorrect use of Provenance? We are having some discussion internally as to whether Provenance should even have anything to do with Groups in the first place.
Grahame Grieve (Aug 27 2020 at 21:49):
I think so. Provenance is about the record keeping. It's still not clear to me who's actually in the group
Jon Fulk (Aug 28 2020 at 12:19):
@Grahame Grieve The group is the patients being seen by the practitioner whose NPI we're trying to reference. The practitioner creates the group (or roster) of patients, and we associate that group to the practitioner so that we can ensure that we are sending the correct beneficiary claims data to the correct practitioner, verifying that the requesting practitioner has access to the requested claims data.
Grahame Grieve (Aug 28 2020 at 23:01):
so when the practitioner creates the group, he lists his patients? or the list is supposed to figured out algorithmically?
Jon Fulk (Aug 29 2020 at 16:43):
@Grahame Grieve The practitioner creates the group and lists his own patients. He then can request claims data for everyone in the group, but we only allow the data to be returned under certain conditions, one of which is that the provider NPI on the claim matches the provider's NPI.
Grahame Grieve (Aug 30 2020 at 00:30):
hmm ok. so why does the group need characteristics if the author of the group lists patients explicitly?
Last updated: Apr 12 2022 at 19:14 UTC