Uploaded image for project: 'FHIR Specification Feedback'
  1. FHIR Specification Feedback
  2. FHIR-27232

I shall discorage using implicit indexing

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Not Persuasive
    • Icon: Medium Medium
    • Shorthand (FHIR)
    • 0.12.0 [deprecated]
    • FHIR Infrastructure
    • Language Reference
    • 3.2.2
    • Hide

      The comment emphasizes the possibility of mistaking an array for a scalar because of the shortcut of assuming the [0] element if the index is not explicit. The important thing is that we do not force anyone to use this shortcut, and if users of FSH feel it could be confusing, they do not have to use it. For other users, the shortcut creates convenience, in particular, when using a fixed value rule on CodeableConcept, instead of saying CodeableConcept.Coding[0]

      Proposed resolution is to keep the shortcut for the first element in an array.

      Show
      The comment emphasizes the possibility of mistaking an array for a scalar because of the shortcut of assuming the [0] element if the index is not explicit. The important thing is that we do not  force anyone to use this shortcut, and if users of FSH feel it could be confusing, they do not have to use it. For other users, the shortcut creates convenience, in particular, when using a fixed value rule on CodeableConcept, instead of saying CodeableConcept.Coding [0] .  Proposed resolution is to keep the shortcut for the first element in an array.
    • Moesel/Rhodes 11-0-1

    Description

      I am opposing the allowed possibility not to specify the element index and then to default it to [0]. This reduces readability and understandability of the specification. If I see a rule:
      * name[0]\.given[1] = "Marie"
      it gives me information on that name is an array and that I am assigning the firs element\. If I see a rule:
      * name\.given[1] = "Marie"
      then, without seying the declaration of name, I am under a faulse impression that name is a non-array type\. This them brings uncertainty about all of the properties not used with the index\. I can never be sure if they are of non-array type\. To check and every one of them for the exact type would require additional effort\.
      So bringing this syntactic shugar into the spec saves one typing 3 characters and brings a whole lot uncertanty to all the other users of the entire spec\.
      Another example then could be changing the property from non-array to array type\. With the paths allowing such defaults any rules using this property would keep working fine, not requiring any attention\. However "convenient", I see this as a "bad thing", as then the semantical menaning of the property has changed and one has to check each and every property use for correctness\. So, I do not find introducing such defaults well justified\.

      Existing Wording:

      If the index is omitted, the first element of the array ([0]) is assumed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ivan_zapreev Ivan Zapreev (Inactive)
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: