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

Eligibility check sample bot #3

Merged
merged 5 commits into from
May 31, 2022
Merged

Eligibility check sample bot #3

merged 5 commits into from
May 31, 2022

Conversation

reshmakh
Copy link
Member

No description provided.

Copy link
Contributor

@justinko43 justinko43 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Reshma, added a couple of comments! I went ahead and looked back at the opkit bot code and cleaned things up quite a bit and posted them up as comments.

Let me know if these comments makes sense. Happy to hop if you need some more context.

src/eligibility-check-opkit.ts Outdated Show resolved Hide resolved
src/eligibility-check-opkit.ts Show resolved Hide resolved
src/eligibility-check-opkit.ts Show resolved Hide resolved
const coverageEligibilityRequest = await medplum.createResource({
resourceType: 'CoverageEligibilityRequest',
identifier: [{
system: 'www.opkit.co/id', //You should choose this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system should be 'https://api.opkit.co/v1/eligibility_inquiries/{id}'

resourceType: 'CoverageEligibilityRequest',
identifier: [{
system: 'www.opkit.co/id', //You should choose this
value: 'opkit-identifier1234' //Ideally something like opkitRequest.subscriber?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be opkitRequest.id!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opkitRequest doesn't have an id (see line 30)?

{
focal: true,
coverage: createReference(coverage),
businessArrangement: 'opkit-identifier1234' //If there is some kind of contract number?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the Eligibility responses from insurance companies don't expose contract numbers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted

outcome: 'complete',
purpose: ['validation', 'benefits'],
request: createReference(coverageEligibilityRequest),
disposition: 'Policy is currently in-force.', //Won't this come from opkit?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I originally just hardcoded this to see if I could properly create the coverageEligibilityResponse.

Here is the additional code I would add to check for active/inforce insurance:

const isPlanActive = (opkitResult.plan.benefits) => {
  const activeStatusBenefit = benefitFeatures.find(
    (benefit) =>
      benefit.type === "active_coverage" &&
      benefit.service === "health_benefit_plan_coverage",
  );

  return !!activeStatusBenefit;
};

And then we could do something like

disposition: isPlanActive ? "Policy is currently in-force" : "Policy is currently not in-force";

services: serviceTypes,
};

const result: any = await fetch('https://api.opkit.co/v1/eligibility_inquiries', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codyebberson - what do you think about having a convenience wrapper around medplum.post to call out to apis. Thinking it could:

  • accept a mime type, but default to JSON
  • do the JSON wrapping / unwrapping
  • accept a param for {authType, authKey}

in_network: 'in',
};

const coverageToBenefitUnitMap: Record<string, string> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Down the road, it feels like all these maps are probably good candidates for the FHIR Mapping Language functionality (or ConceptMaps, I'm not sure which)

@reshmakh reshmakh changed the title Do not merge - awaiting feedback Eligibility check sample bot May 27, 2022
@reshmakh reshmakh merged commit 174558b into main May 31, 2022
@reshmakh reshmakh deleted the reshma-opkitbot branch July 27, 2022 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants