Skip to Main Content
InterSystems Ideas
We love hearing from our users. Tell us what you want to see next and upvote ideas from the community.
* Bugs and troubleshooting should as usual go through InterSystems support.
Status Needs review
Created by Jose-Tomas Salvador
Created on Oct 15, 2021

Intellisense for FHIR resources

When someone have to implement code within a FHIR project, it's common to have to build FHIR resources within the program... Right now that means we have to build a DynamicObject and know in advance which are the name of properties of that resource, potential embeded JSON objects and their nested properties, etc...

But, in the end, all the FHIR resources have a JSON representation that is very well established in each FHIR release or FHIR profile that we want to use in our solution. The idea would be to enhance Studio and our VS Code extension, so to make our intellisense mechanism able to identify and help with objects that represent FHIR resources .

Having that, then, for example, when we're coding a dynamicObject that we've declared that will represent a Patient resource of FHIR R4, our intellisense will help us and will offer us the list of properties available for that object in the same way that it would do for whatever object of an IRIS class.

  • Jose-Tomas Salvador
    Reply
    |
    Oct 21, 2022

    Example:

    If we want to use a patient resource or FHIR R4... I want to be able to do:

    // this is a dynamic object... or inherits in some way from it
    set pat = ##class(fhir.r4.patient).%New()

    // intellisense offers me resourceType as a property
    set pat.resourceType = "Patient"

    // intellisense offers me identifier and then use as a property of identifier object... and more important, at run time identifier is automatically created (no runtime object reference errors...)
    set pat.identifier.use = "usual"

    // at runtime the objects in the reference chain are autimatically created
    set pat.identifier.type.coding = [{"system":"http://terminology.hl7.org/CodeSystem/v2-0203", "code": "MR"}]

    //this is a new property that I want to introduce making use of the flexibility of %DynamicObjects...
    set pat.NewProperty = "test"
    ....
    // the resource in JSON text to send, write, store,...use in DTLs,...
    set resJSON = pat.%ToJSON()

    The issue here is how to create that fhir.* package from a JSON schema definition... (in a similar way that we can do today with XSDs for example)... but creating classes that are basically %DynamicObjects/Arrays in essence... with the goal of helping the developer and give the structure required for intellisense to work and, if required, to validate ... (being the classes created we could decide if imposing or not datatype constraints when exporting to JSON for example... or when importing from a JSON file)