I need to add a new value to a value set, and I can’t seem to find an example of how to do that. For example, adding a new status to http://hl7.org/fhir/ValueSet/payment-status
I think I will need to create a structure definition and publish it. So far, I have:
There’s 2 different questions here, extending a value set, and when you can change a binding.
You don’t extend a value set - but you can create a new one that imports the existing value set and includes additional codes or imports other codes. In practice, you’ve ‘extended’ the value set by doing that
the resources are published with codeable elements bound to value sets. Whether you can extend these depends on the binding strength. If the binding strength is ‘preferred’ or ‘example’ then you can make up your own value set as you like. If the binding strength is ‘extensible’ then you can make a new value as described above and bind to that. If the binding strength is ‘required’, then you can’t extend it at all.
Since that appears to be the case here (I infer you are talking about PaymentNotification.status) then your only choice is to go talk to the relevant committee (Finanical management) and ask how they expect your requirement to be handed.
@grahamegrieve I’m actually referring to PaymentNotification.paymentStatus, which has a binding strength of Example.
So, how do I define and use a new value set that includes an existing one? Can you point me to an example? If not, I’d like us to create a minimal example, because I’m sure a lot of FHIR adopters will need to effectively “extend” an existing example value set.
PaymentNotice.status has a binding strength of “required”. That means you can’t use any codes other than the ones listed. If you want to convey more nuanced codes (e.g. payment revoked vs. payment unsuccessful for ‘cancelled’), you’ll need a supplementary extension. If you feel the set of codes doesn’t cover the space, then for now you’ll also need to send an extension, though you should also submit a change request. (In looking at the statuses defined, they seem a tad unintuitive/generic to me, so feel free to provide feedback if you don’t think they’re adequate/appropriate.)
If the binding strength had been anything other than ‘required’ and you wanted to include all of the codes from the existing value set, you’d define a value set like any other (lots of examples of that), and as part of the ‘compose’ element, you’d have “valueset”: “some-valueset-canonical-url”
@lloyd As I explained to Graham and showed in my example, I want to define a new value set that adds a code to PaymentNotice.paymentStatus, which has a binding strength of Example.
I will follow your suggestion for defining a new ValueSet that includes an existing ValueSet by URL, and post my results.
You’re not allowed to. PaymentNotice.status must use the codes HL7 has defined. You’re not allowed to change or override that binding. All you can do is define parallel extensions or try to convince HL7 to change it.
It says “FHIR Release 3 (STU)” across the top, so I’m assuming it’s STU3. Below, for PaymentNotice.paymentStatus it says:
Whether payment has been sent or cleared
Payment Status Codes (Example)
It looks to me as though paymentStatus has a binding strength of Example.
Just to be absolutely clear, PaymentNotice has two status fields: PaymentNotice.status with binding required, and PaymentNotice.paymentStatus with binding strength Example. I am looking to extend PaymentNotice.paymentStatus with binding strength Example.
Apologies. I was looking at PaymentNotice.status, not PaymentNotice.paymentStatus. (I’m a tad confused about the reason for both). In any event, the paymentStatus is indeed example, so you’re free to extend it - or make up a completely different value set entirely.
It appears that the Java validator does not support the use of codes from custom ValueSets. I defined a ValueSet and validated it, and put it online. I then defined a PaymentNotice resource and referenced my custom ValueSet:
First, you can’t use Coding.system to convey a ValueSet reference, only a CodeSystem reference. Second, the validator doesn’t attempt to resolve Coding.system references because few of them will resolve to FHIR instances (they’re not expected to). To get the validator to pay attention to your value set, you’ll need to do the following:
Publish your value set within an igpack (by publishing it as part of the implementation guide)
Create a profile on PaymentNotice that binds the status to your value set and put that in an igpack too. (It can be the same implementation guide if you wish.)
Reference the igpack(s) when invoking the validator using the -ig parameter
Either use meta.profile to declare the profile in your instance or specify the full profile URL as an argument to the validator