Have you implemented OpenMRS? Please participate in the Implementation Site Survey. If you already have, thank you!
Child pages
  • Using local extension
Skip to end of metadata
Go to start of metadata

This page describes how local extensions are implemented.

Local extensions were created to have base code that will be used for real extensions when they will be registered by OpenMRS community and ready to use.

In ExtensionsURL class we keep URLs of extensions that we are using. Because some extensions are not registered yet we decided to use simple name of extensions as replacement for URL.

public final class ExtensionURL {

    private ExtensionURL() { }

    /** https://simplifier.net/SRxProject/resource-date-created/~json */
    public static final String DATE_CREATED_URL = "http://fhir-es.transcendinsights.com/stu3/StructureDefinition/resource-date-created";

    /** https://simplifier.net/eLabTest/Creator-crew-version1/~json */
    public static final String CREATOR_URL = "https://purl.org/elab/fhir/StructureDefinition/Creator-crew-version1";

    // Local extensions
    public static final String CHANGED_BY_URL = "changedBy";
    public static final String DATE_CHANGED_URL = "dateChanged";
    public static final String VOIDED_URL = "voided";

Above code snippet shows few local extensions that we created.

Replacing local extensions

When some extension will be registered we should use it in FHIR code. Let's suppose that "changedBy" extension is registered under URL - "https://openmrs.org/fhir/StructureDefinition/changed-by". All you have to do is replacing value of CHANGED_BY_URL with this URL. 

  • No labels