Differences between FHIR R4 spec and Medplum?
# support
m
For the Range datatype, I noticed that there seems to be a difference between the FHIR spec and medplum's implementation. FHIR has Range.low and Range.high as SimpleQuantity type but Medplum has them as Quantity type. https://hl7.org/fhir/R4/datatypes.html#Range https://www.medplum.com/docs/api/fhir/datatypes/range If my understanding is correct, was this on purpose and are there other places that medplum's implementation is slightly different? If so, I wonder if this might be a good thing to document in the medplum docs.
Also on a related note, SimpleQuantity and Quantity are the same in medplum (but different in the FHIR spec): https://www.medplum.com/docs/api/fhir/datatypes/simplequantity https://www.medplum.com/docs/api/fhir/datatypes/quantity
n
Not an expert but I believe
SimpleQuantity
is technically a profile of
Quantity
, not its own datatype. If you search for "Range.low" or "Range.high" in [dataelements.json](https://raw.githubusercontent.com/medplum/medplum/refs/heads/main/packages/definitions/src/fhir/r4/dataelements.json), you can see the profile applied there, so Medplum appears to handle it correctly.
MoneyQuantity
is a similar special case. The SimpleQuantity vs Quantity medplum docs you linked do distinguish that
comparator
is not allowed in
SimpleQuantity
TL;DR: I think the implementation looks correct;
Range
docs could potentially point to
SimpleQuantity
in the
Type
column, like R4 does in those special cases
Copy code
"type" : "Range.low",
      "baseDefinition" : "http://hl7.org/fhir/StructureDefinition/Element",
      "derivation" : "specialization",
      "snapshot" : {
        "element" : [{
          "id" : "Range.low",
          "path" : "Range.low",
          "short" : "Low limit",
          "definition" : "The low limit. The boundary is inclusive.",
          "comment" : "If the low element is missing, the low boundary is not known.",
          "min" : 0,
          "max" : "1",
          "base" : {
            "path" : "Range.low",
            "min" : 0,
            "max" : "1"
          },
          "type" : [{
            "code" : "Quantity",
            "profile" : ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]
          }],
          "isModifier" : false,
          "isSummary" : true,
          "mapping" : [{
            "identity" : "v2",
            "map" : "NR.1"
          },
          {
            "identity" : "rim",
            "map" : "./low"
          }]
        }]
      }
46 Views