Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to PDex Drug Formulary 1.1.0 #3652

Closed
lmsurpre opened this issue May 20, 2022 · 3 comments
Closed

Update to PDex Drug Formulary 1.1.0 #3652

lmsurpre opened this issue May 20, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@lmsurpre
Copy link
Member

lmsurpre commented May 20, 2022

Is your feature request related to a problem? Please describe.
PDex Drug Formulary 1.1.0 was published last fall... its time we add that to our fhir-ig-pdex-formulary module.

Describe the solution you'd like
Add 1.1.0 alongside 1.0.1 ...similar to #3651 .

We should also move the corresponding examples from fhir-examples down to src/test/resources/examples/100 and add the new examples alongside those in a 110 directory.

Describe alternatives you've considered
Replace 1.0.1 with 1.1.0

Acceptance Criteria

  1. GIVEN the fhir-ig-davinci-pdex-formulary jar is in userlib
    WHEN a resource is validated against an applicable profile with no version suffix (or specifies a version of 1.1.0)
    THEN validation uses the artifacts from PDex Drug Formulary 1.1.0

  2. GIVEN the fhir-ig-davinci-pdex-formulary jar is in userlib
    WHEN a resource is validated against an applicable profile with a version id of 1.0.1
    THEN validation uses the artifacts from PDex Drug Formulary 1.0.1

Additional context

@lmsurpre lmsurpre added the enhancement New feature or request label May 20, 2022
@lmsurpre lmsurpre self-assigned this May 20, 2022
lmsurpre added a commit that referenced this issue May 20, 2022
Following the same pattern from PDEX PlanNet

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 20, 2022
* extension type profiles and value set bindings on StructureDefinitions
* meta.profile entries on examples

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre
Copy link
Member Author

lmsurpre commented May 22, 2022

Unfortunately, PDEX Drug Formulary 1.1.0 is not backwards compatible with version 1.0.1.

Currently, when the IBM FHIR Server sees an extension, it looks up the corresponding extension definition in the registry and checks for conformance. This happens outside of any profile validation.

However, because extension urls are never versioned, this means that we'll always look up the latest definition. This makes us quite sensitive to extension definitions that change over time.

In PDEX US Drug Formulary 1.1.0, the following extension values have changed from type string to type uri:

To further complicate matters, the code display names in many of the CodeSystems have changed as well:

These CodeSystem are referenced from http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-DrugTierDefinition-extension and some are required.

These breaking changes mean that a valid 1.0.1 instance will be invalid in version 1.1.0 and, because we check extensions separate from profile validation, such instances will fail our validation just by having the 1.1.0 versions in the registry.

For this reason, I'm thinking that maybe we should split version 1.1.0 into a separate jar from 1.0.1 (or avoid packaging it altogether).
The alternative would be to try making our Validator more intelligent: if an extension url is mentioned in the profile, and the profile indicates a particular version of that extension, then only check against that version (and not the latest). This will be tricky because, as mentioned above, the extension validation happens independent of profile validation today.

lmsurpre added a commit that referenced this issue May 22, 2022
* extension type profiles and value set bindings on StructureDefinitions
* meta.profile entries on examples

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
Following the same pattern from PDEX PlanNet

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
* extension type profiles and value set bindings on StructureDefinitions
* meta.profile entries on examples

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
Following the same pattern from PDEX PlanNet

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
* extension type profiles and value set bindings on StructureDefinitions
* meta.profile entries on examples

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
Following the same pattern from PDEX PlanNet

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
* extension type profiles and value set bindings on StructureDefinitions
* meta.profile entries on examples

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
Following the same pattern from PDEX PlanNet

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 24, 2022
* extension type profiles and value set bindings on StructureDefinitions
* meta.profile entries on examples

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue May 27, 2022
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Jun 9, 2022
issue #3652 - add PDEX Drug Formulary 1.1.0
lmsurpre added a commit that referenced this issue Jun 9, 2022
@lmsurpre
Copy link
Member Author

I ended up implementing this:

if an extension url is mentioned in the profile, and the profile indicates a particular version of that extension, then only check against that version

@PrasannaHegde1
Copy link
Collaborator

PrasannaHegde1 commented Aug 23, 2022

Tried with a sample resource with a profile version id of 1.0.1, changed the MarketingURL-extension, SummaryURL-extension, FormularyURL-extension, EmailPlanContact-extension from type string to type uri and the validation returned errors.

{
    "resourceType": "OperationOutcome",
    "id": "Error",
    "text": {
        "status": "additional",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>ERROR</p></div>"
    },
    "issue": [
        {
            "severity": "error",
            "code": "invariant",
            "details": {
                "text": "generated-usdf-CoveragePlan~List.extension<http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyURL-extension>: Constraint violation: extension('http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyURL-extension').exists() implies (extension('http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyURL-extension').count() = 1 and extension('http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyURL-extension').all(conformsTo('http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyURL-extension|1.0.1')))"
            },
            "diagnostics": "Caused by: [[expression: value.as(string).exists(), result: false, location: List.extension[2]]]",
            "expression": [
                "List"
            ]
        },
        {
            "severity": "information",
            "code": "invariant",
            "details": {
                "text": "generated-usdf-FormularyURL-extension-2: Constraint violation: value.as(string).exists()"
            },
            "expression": [
                "List.extension[2]"
            ]
        }
    ]
}

Tried with a sample resource with a profile version id of 1.0.1 with valid MarketingURL-extension, SummaryURL-extension, FormularyURL-extension, EmailPlanContact-extension types(type string) and the validation was successful.

{
    "resourceType": "OperationOutcome",
    "id": "NoError",
    "text": {
        "status": "additional",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>No error</p></div>"
    },
    "issue": [
        {
            "severity": "information",
            "code": "informational",
            "details": {
                "text": "All OK"
            }
        }
    ]
}

Tried with a sample resource with a profile version id of 1.0.1 with invalid code display names for DrugTierCS, CoinsuranceOptionCS, CopayOptionCS, PharmacyTypeCS for version 1.0.1 and the validation returned "code-invalid".

{
    "resourceType": "OperationOutcome",
    "id": "NoError",
    "text": {
        "status": "additional",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>No error</p></div>"
    },
    "issue": [
        {
            "severity": "information",
            "code": "code-invalid",
            "details": {
                "text": "generated-usdf-DrugTierDefinition-extension-1: A code in this element must be from the specified value set 'http://hl7.org/fhir/us/davinci-drug-formulary/ValueSet/DrugTierVS|1.0.1' if possible"
            },
            "expression": [
                "List.extension[0].extension[0].value"
            ]
        }
    ]
}

Tried with a sample resource with a profile version id of 1.0.1 with valid code display names for DrugTierCS, CoinsuranceOptionCS, CopayOptionCS, PharmacyTypeCS for version 1.0.1 and the validation was successful.

{
    "resourceType": "OperationOutcome",
    "id": "NoError",
    "text": {
        "status": "additional",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>No error</p></div>"
    },
    "issue": [
        {
            "severity": "information",
            "code": "informational",
            "details": {
                "text": "All OK"
            }
        }
    ]
}

This is working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants