Fix potential null pointer exception when checking if a primitive extension is primary
Fix potential null pointer exception when checking if a primitive extension is primary

We sometimes use primitive extensions (e.g., `primitive-string-extension`), but these won't have associated Elements.  The isPrimaryFn was trying to get and operate on the element associated with these -- which didn't work (since there is none).  A null check fixes the problem.

(cherry picked from commit d1788e0a31bd3495b94772a7e02fe9ce458ec506)

standardhealth/shr-fhir-export,standardhealth/shr-fhir-export