- 
        Couldn't load subscription status. 
- Fork 354
Description
Describe the bug
When an "extension only" value is provided to the startsWith('xxx') function, a null reference exception is thrown.
This is due to the code going direct to the system string functions without handling any of the null stuff.
| t.Add("startsWith", (string f, string fragment) => f.StartsWith(fragment), doNullProp: true); | 
To Reproduce
Steps to reproduce the behavior:
Run the below expression on this test instance
{
    "resourceType": "Patient",
    "id": "example",
    "managingOrganization": {
        "_reference": { "id": "element id" }
    }
}Can test this in the fhirpath lab too.
managingOrganization.trace('v').reference.startsWith('#')
Returns the error:
Invalid expression: Invocation of function 'startsWith' failed: Object reference not set to an instance of an object.
Expected behavior
This not throw an error and return an empty set as there is no primitive string.
(check the spec, there are some other issues around this at the moment also...)
https://chat.fhir.org/#narrow/channel/179266-fhirpath/topic/result.20of.20toString.20with.20extension.20only.20value
Version used:
- FHIR Version: R4
- Version: v5.10.0