Stream: shorthand
Topic: Is not a valid URI
Muthu Muthuraj (Jul 20 2020 at 15:53):
I am pretty new to FSH and learning things.... I am doing profiling for my teams and I have the following questions. I am enclosing two short hand scripts, the first one works, and the second one does not. The variation is the former is a ValueSet and the later is a CodeSystem. Can you experts help point out what am I doing wrong here?
Working version.
Snippet from the Specimen profile FSH Script
=======================================
- identifier.type 1..1
- identifier.type from xxx-specimen-id-types
The Specimen ID types ValueSet derived from HL7 types
================================================
Alias: IDT = http://hl7.org/fhir/ValueSet/identifier-type
ValueSet: xxxSpecimentIdentifierTypes
Id: xxx-specimen-id-types
Title: "xxx Specimen Identifier types"
Description: "Specimen Identifier types supported by xxx"
- IDT#PLAC "Specimen's identifier if accessioned outside of xxx"
- IDT#ACSN "Accession ID - If accessioned using xxx workflow"
- IDT#FILL "Specifimen identifier for internal tracking in xxx"
This compiles perfectly, no issues.
Snippet from the ServiceRequest profile FSH Script
=======================================
- identifier.type 1..1
- identifier.type from xxx-order-id-types
The Order ID types CodeSystem of our own list
=======================================
CodeSystem: xxxOrderIdentifierTypes
Id: xxx-order-id-types
Title: "Various types of identifiers that can be used in diagnostic order to xxx"
Description: "Various types of identifiers that can be used in diagnostic order to xxx"
- #MR "MR" "Medical record number"
- #ACSN "ACSN" "Accession ID"
- #PRN "PRN" "Physician ID"
- #NPI "NPI" "Physician NPI"
- #ACCN "ACCN" "Account Number"
- #PLAC "PLAC" "Placer Order ID"
- #FILL "FILL" "Filler Order ID"
- #PREQ "PREQ" "Placer Request ID"
- #REQ "REQ" "Request ID"
The above fails
error Resolved value "xxx-order-id-types" is not a valid URI.
My custom extensions to ID types are only PRN, NPI PREQ and REQ the rest are in the ValueSet http://hl7.org/fhir/ValueSet/identifier-type. I did not find instruction how to form a ValueSet (if possible) derived partly from mulitple ValueSets intermixed with our own CodeSystem values.
Thanks for your help in advance.
Jean Duteau (Jul 20 2020 at 16:01):
The error is in your ServiceRequest FSH script and it is because you can't bind an element to a code system.
Chris Moesel (Jul 20 2020 at 17:23):
Thanks, @Jean Duteau. I think you nailed it. That said, it seems that SUSHI should provide a more helpful error message there. I'll add an issue to improve that.
Muthu Muthuraj (Jul 20 2020 at 17:33):
Can you guys provide me guidance on what is the right way to use Code Systems. SUSHI site tells us how to define one, but does not tell us how to use them with an example?
Jean Duteau (Jul 20 2020 at 17:34):
I told you in our private chat. Your CodeSystem is just fine. You now need to create a ValueSet that references the codes you want. And then the Profile binds the ServiceRequest.identifier.type to that value set. Just like you did in your Specimen profile.
Muthu Muthuraj (Jul 20 2020 at 17:36):
I just saw it! Thanks Jean!
Muthu Muthuraj (Jul 20 2020 at 17:50):
Jean Duteau said:
your codesystem is just fine. it's the fact that profile elements can't reference a codesystem directly. profile elements always have to reference a valueset. so you would need to define a value set that references the codesystem and then the profile element reference that value set.
Can I do this to resolve the problem? I am still getting the same error:
- identifier.type 1..1
- identifier.type from xxx-order-id-vs
ValueSet: xxxOrderIdVS
Id: xxx-order-id-vs
Title: "Valid Order ID types for xxx"
Description: "Valid Order ID types for xxx"
*include codes from CodeSystem xxx-order-id-cs
Nick Freiter (Jul 20 2020 at 17:55):
Instead of include codes from CodeSystem xxx-order-id-cs
, the FSH syntax is include codes from system xxx-order-id-cs
.
Chris Moesel (Jul 20 2020 at 17:58):
Also... you need a space between the *
and include
(i.e., * include
not *include
).
Chris Moesel (Jul 20 2020 at 18:00):
And in case you were not aware, you don't have to reference it by the Id
-- you can reference it by the name if that is easier (the name is the part after CodeSystem:
).
Muthu Muthuraj (Jul 20 2020 at 18:16):
Thank you for pointing out the typo on *include.... Here is what I have
- identifier.type 1..1
- identifier.type from xxx-order-id-vs
ValueSet: xxxOrderIDTypeVS
Id: xxx-order-id-vs
Title: "Valid Order requests for xxx"
Description: "Valid Order requests for xxx"
- include codes from system xxx-order-id-cs
CodeSystem: xxxOrderIdentifierCS
Id: xxx-order-id-cs
Title: "Various types of identifiers that can be used in diagnostic order to xxx"
Description: "Various types of identifiers that can be used in diagnostic order to xxx"
- #MR "MR" "Medical record number"
- #ACSN "ACSN" "Accession ID"
- #PRN "PRN" "Physician ID requestForms.PhysicianID"
- #NPI "NPI" "Physician NPI"
...
...
error mismatched input 'codes' expecting CARET_SEQUENCE
File: xxxOrderIdTypeVS.fsh
Line: 6
error Error in parsing: Cannot read property 'getText' of null
File: xxxOrderIdTypeVS.fsh
Line: 1 - 6
error Resolved value "xxx-order-id-vs" is not a valid URI.
File: xxxOrder.fsh
Line: 44
Jean Duteau (Jul 20 2020 at 18:27):
Nick Freiter said:
Instead of
include codes from CodeSystem xxx-order-id-cs
, the FSH syntax isinclude codes from system xxx-order-id-cs
.
@Nick Freiter With SUSHI 0.13.1, * include codes from ... fails with the errors that Muthu posted above.
@Muthu Muthuraj You need to have SUSHI 0.14.0 to use the * include codes from ... line.
Here is a test file that processes successfully in SUSHI 0.13.1 (which I suspect you are using) or 0.14.0.
TestScript.fsh
Muthu Muthuraj (Jul 20 2020 at 18:33):
Running SUSHI v0.12.5
I guess I have not been upgrading in a while... I will have to figure out how to update...
Jean Duteau (Jul 20 2020 at 18:34):
npm install -g fsh-sushi :)
Muthu Muthuraj (Jul 20 2020 at 18:36):
Jean Duteau said:
npm install -g fsh-sushi :)
Alright!! That fixed it :) Where do I send your bottle of red wine from my side .. :)
David Hay (Jul 20 2020 at 18:42):
I'lll send you the address - you can trust me to pass it on...
Last updated: Apr 12 2022 at 19:14 UTC