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

No code found in instance when there is a code #632

Closed
ewoutkramer opened this issue Jul 3, 2018 · 4 comments
Closed

No code found in instance when there is a code #632

ewoutkramer opened this issue Jul 3, 2018 · 4 comments
Assignees
Labels

Comments

@ewoutkramer
Copy link
Member

See https://chat.fhir.org/#narrow/stream/4-implementers/subject/value.20or.20child.20or.20Null.3F

Validating this will give an error on Bundle.entry[0].resource[0].dosageInstruction[1].route[0]:
Code Invalid : No code found in instance.

<Bundle xmlns="http://hl7.org/fhir">
<id value="d3e1"/>
<type value="searchset"/>
<total value="1"/>
<entry>
<fullUrl value="medbeh_VMA_001_MA02--1.2.3.999"/>
<resource>
<MedicationRequest>
<meta>
<profile value="http://nictiz.nl/fhir/StructureDefinition/zib-MedicationAgreement"/>
</meta>
<!--voorschrijver-->
<contained>
<Practitioner>
<id value="d3e58"/>
<!--zorgverlener_identificatie_nummer-->
<identifier>
<system value="http://fhir.nl/fhir/NamingSystem/uzi-nr-pers"/>
<value value="006797896"/>
</identifier>
<!--naamgegevens-->
<name>
<family>
<extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-prefix">
<valueString value="van"/>
</extension>
<extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-name">
<valueString value="Beek"/>
</extension>
</family>
<given value="Johan">
<extension url="http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier">
<valueCode value="BR"/>
</extension>
</given>
<given value="J.">
<extension url="http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier">
<valueCode value="IN"/>
</extension>
</given>
</name>
</Practitioner>
</contained>
<!--voorschrijver / zorgaanbieder-->
<contained>
<Organization>
<id value="d3e83"/>
<identifier>
<system value="http://fhir.nl/fhir/NamingSystem/ura"/>
<value value="00765332"/>
</identifier>
<identifier>
<system value="http://fhir.nl/fhir/NamingSystem/agb-z"/>
<value value="01028432"/>
</identifier>
<name value="Huisartspraktijk Van Beek"/>
</Organization>
</contained>
<extension url="http://nictiz.nl/fhir/StructureDefinition/zib-MedicationUse-Duration">
<valueDuration>
<value value="10"/>
<unit value="dag"/>
<system value="http://unitsofmeasure.org"/>
<code value="d"/>
</valueDuration>
</extension>
<extension url="http://nictiz.nl/fhir/StructureDefinition/zib-Medication-MedicationTreatment">
<valueIdentifier>
<system value="urn:oid:1.2.3.999"/>
<value value="medbeh_VMA_001"/>
</valueIdentifier>
</extension>
<identifier>
<system value="urn:oid:1.2.3.999"/>
<value value="medbeh_VMA_001_MA02"/>
</identifier>
<intent value="order"/>
<category><!--medicatieafspraak-->
<coding>
<system value="http://snomed.info/sct"/>
<code value="16076005"/>
<display value="Prescription (procedure)"/>
</coding>
</category>
<!--geneesmiddel-->
<medicationCodeableConcept>
<coding>
<system value="urn:oid:12.3.999"/>
<code value="19844"/>
<display value="19844 DOXYCYCLINE TABLET 100MG"/>
</coding>
</medicationCodeableConcept>
<subject>
<identifier>
<system value="http://fhir.nl/fhir/NamingSystem/bsn"/>
<value value="32456487"/>
</identifier>
<display value="Antje de Vries"/>
</subject>
<!--afspraakdatum-->
<authoredOn value="2016-09-02T14:30:23+02:00"/>
<requester>
<agent>
<reference value="#d3e58"/>
<display value="Johan J. van Beek"/>
</agent>
<onBehalfOf>
<reference value="#d3e83"/>
<display value="Huisartspraktijk Van Beek"/>
</onBehalfOf>
</requester>
<!--reden afspraak-->
<reasonCode>
<coding>
<system value="http://snomed.info/sct"/>
<code value="438833006"/>
<display value="Contra-indicatie"/>
</coding>
</reasonCode>
<!--toelichting-->
<note>
<text value="Patiënt gebruikt Verapamil, contra-indicatie voor het origineel voorgeschreven Klacid."/>
</note>
<dosageInstruction>
<sequence value="1"/>
<text value="Gedurende 10 dagen, eerste dag 2 tabletten en vervolgens 1x daags 1 tablet"/>
<timing>
<repeat><!--doseerduur-->
<boundsDuration>
<value value="1"/>
<unit value="dag"/>
<system value="http://unitsofmeasure.org"/>
<code value="d"/>
</boundsDuration>
<!--toedieningsduur-->
<frequency value="1"/>
<!--frequentie/tijdseenheid-->
<period value="1"/>
<periodUnit value="d"/>
</repeat>
</timing>
<route>
<extension url="http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor">
<valueCode value="NI"/>
</extension>
</route>
<doseQuantity>
<value value="2"/>
</doseQuantity>
</dosageInstruction>
<dosageInstruction>
<sequence value="2"/>
<text value="Gedurende 10 dagen, eerste dag 2 tabletten en vervolgens 1x daags 1 tablet"/>
<timing>
<repeat><!--doseerduur-->
<boundsDuration>
<value value="9"/>
<unit value="dag"/>
<system value="http://unitsofmeasure.org"/>
<code value="d"/>
</boundsDuration>
<!--toedieningsduur-->
<frequency value="1"/>
<!--frequentie/tijdseenheid-->
<period value="1"/>
<periodUnit value="d"/>
</repeat>
</timing>
<route>
<extension url="http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor">
<valueCode value="NI"/>
</extension>
</route>
<doseQuantity>
<value value="1"/>
</doseQuantity>
</dosageInstruction>
<!-- Responsible dispensing pharmacy -->
</MedicationRequest>
</resource>
</entry>
</Bundle>
@ewoutkramer
Copy link
Member Author

The validator complains that you have given a coded field (here: ), but did not actually pass in a code. The code in the nullflavour does not count - that's merely stating WHY there is no code given. But the fact remains that there is no code given for the route.

So what should the validator do? Just let this pass? That means that I could make valid instances without picking a code from a valueset - in the worst case even when this is a required binding - just by throwing in any extension.

I will reach out to @grahamegrieve to find out what the Java validator would do (and under which circumstances).

@ewoutkramer
Copy link
Member Author

ewoutkramer commented Nov 26, 2018

Hi Grahame - what does you validator do when evaluating a code against a binding and:

There is no code given (empty CodeableConcept)
There is a coding, but the Coding.code is empty

This is what the Java validator does:

Grahame Grieve: depends on the binding strength
Grahame Grieve: if it's required those are both an error

Grahame Grieve: if it's extensible, it's an error if there's no text

Grahame Grieve: otherwise it's not an error

@ewoutkramer
Copy link
Member Author

So, we will need to adapt the validator to use the same approach.

@ewoutkramer
Copy link
Member Author

Fixed by #931.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant